Uma área de pesquisa sobre o WordPress para devs e autores do tema



get_meta_sql ›

Desde3.2.0
Obsoleton/a
get_meta_sql ( $meta_query, $type, $primary_table, $primary_id_column, $context = null )
Parâmetros: (5)
  • (array) $meta_query A meta query.
    Required: Yes
  • (string) $type Type of meta.
    Required: Yes
  • (string) $primary_table Primary database table name.
    Required: Yes
  • (string) $primary_id_column Primary ID column name.
    Required: Yes
  • (object) $context Optional. The main query object
    Required: No
    Padrão: null
Ver:
  • WP_Meta_Query
Retorna:
  • (array) Associative array of `JOIN` and `WHERE` SQL.
Definido em:
Codex:

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



Fonte

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 );
}