Inventory_Presser_Plugin::meta_query_contains_clause( mixed $meta_query, mixed $key, mixed $value, mixed $compare, mixed $type )

Checks if a meta_query already contains a clause.


Parameters Parameters

$meta_query

(mixed) (Required)

$key

(mixed) (Required)

$value

(mixed) (Required)

$compare

(mixed) (Required)

$type

(mixed) (Required)


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: inventory-presser.php

		public static function meta_query_contains_clause( $meta_query, $key, $value, $compare, $type ) {
			if ( is_array( $meta_query ) ) {
				if ( isset( $meta_query['key'] )
					&& isset( $meta_query['value'] )
					&& isset( $meta_query['compare'] )
					&& isset( $meta_query['type'] )
				) {
					return $meta_query['key'] === $key
					&& $meta_query['value'] === $value
					&& $meta_query['compare'] === $compare
					&& $meta_query['type'] === $type;
				}

				foreach ( $meta_query as $another ) {
					return self::meta_query_contains_clause( $another, $key, $value, $compare, $type );
				}
			}
			return false;
		}