wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_meta_sql › WordPress Function

Depuis3.2.0
Dépréciéen/a
get_meta_sql ( $meta_query, $type, $primary_table, $primary_id_column, $context = null )
Paramètres: (5)
  • (array) $meta_query A meta query.
    Requis: Oui
  • (string) $type Type of meta.
    Requis: Oui
  • (string) $primary_table Primary database table name.
    Requis: Oui
  • (string) $primary_id_column Primary ID column name.
    Requis: Oui
  • (object) $context Optional. The main query object. Default null.
    Requis: Non
    Défaut: null
Voir:
  • WP_Meta_Query
Retourne:
  • (string[]|false) { Array containing JOIN and WHERE SQL clauses to append to the main query, or false if no table exists for the requested meta type. @type string $join SQL fragment to append to the main JOIN clause. @type string $where SQL fragment to append to the main WHERE clause. }
Défini(e) dans:
Codex:

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



Source

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