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

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

Leave a comment