Advertisements

get_meta_sql

Definition:
function get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $context = null ) {}

Given a meta query, generates SQL clauses to be appended to a main query

Parameters

  • array $meta_query: A meta query
  • string $type: Type of meta
  • string $primary_table
  • string $primary_id_column
  • object $context: (optional) The main query object

Return values

returns:‘join’ => $join_sql, ‘where’ => $where_sql )

Source code

function get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $context = null ) {

	$meta_query_obj = new WP_Meta_Query( $meta_query );

	return $meta_query_obj->get_sql( $type, $primary_table, $primary_id_column, $context );

}

13864

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: