get_meta_sql

过滤钩子
apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context )
参数
  • (string[]) $sql Array containing the query's JOIN and WHERE clauses.
    Required:
  • (array) $queries Array of meta queries.
    Required:
  • (string) $type Type of meta. Possible values include but are not limited to 'post', 'comment', 'blog', 'term', and 'user'.
    Required:
  • (string) $primary_table Primary table.
    Required:
  • (string) $primary_id_column Primary column ID.
    Required:
  • (object) $context The main query object that corresponds to the type, for example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`.
    Required:
定义位置
相关勾子
get_date_sqlget_tagsget_comment_linkget_avatar_urlget_comment_id
相关方法
get_meta_sqlget_tax_sqlget_meta_keys_get_meta_tableget_tagsget_comments
引入
3.1.0
弃用
-

get_meta_sql: 这个函数返回用于从数据库中检索元数据的SQL代码。它需要几个参数,包括要检索的元数据的类型和与之相关的对象的类型。

过滤元查询的生成的SQL。

return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );

常见问题

FAQs
查看更多 >