src/WordPress/Models/PostBuilder.php
function with($meta, $operator = null, $value = null)
	{
		
		list($value, $operator) = $this->prepareValueAndOperator(
			$value, $operator, func_num_args() == 2
		);

		static $count;
		if (empty($count)) {
			$count = 0;
		}
		
		if (!is_array($meta)) {
			$meta = [ $meta => $value ];
		}

		foreach($meta as $key => $value) {
			$alias = '_with_condition_'.(++$count);
			$this->query->join("postmeta as {$alias}", "{$alias}.post_id", '=', 'ID');
			$this->query->where("{$alias}.meta_key", '_' . $key);
			$this->query->where("{$alias}.meta_value", $operator, $value);
		}

		return $this;
	}
function with($meta, $operator = null, $value = null)
	{
		
		list($value, $operator) = $this->prepareValueAndOperator(
			$value, $operator, func_num_args() == 2
		);

		static $count;
		if (empty($count)) {
			$count = 0;
		}
		
		if (!is_array($meta)) {
			$meta = [ $meta => $value ];
		}

		foreach($meta as $key => $value) {
			$alias = '_with_condition_'.(++$count);
			$this->query->join("postmeta as {$alias}", "{$alias}.post_id", '=', 'ID');
			$this->query->where("{$alias}.meta_key", '_' . $key);
			$this->query->where("{$alias}.meta_value", $operator, $value);
		}

		return $this;
	}
function with ( $ meta , $ operator = null , $ value = null ) { list ( $ value , $ operator ) = $ this -> prepareValueAndOperator ( $ value , $ operator , func_num_args ( ) == 2 ) ; static $ count ; if ( empty ( $ count ) ) { $ count = 0 ; } if ( ! is_array ( $ meta ) ) { $ meta = [ $ meta => $ value ] ; } foreach ( $ meta as $ key => $ value ) { $ alias = '_with_condition_' . ( ++ $ count ) ; $ this -> query -> join ( "postmeta as {$alias}" , "{$alias}.post_id" , '=' , 'ID' ) ; $ this -> query -> where ( "{$alias}.meta_key" , '_' . $ key ) ; $ this -> query -> where ( "{$alias}.meta_value" , $ operator , $ value ) ; } return $ this ; }
Add one or more meta data conditions to the query.
Add one or more meta data conditions to the query .