get_meta_sql WordPress Filter Hook

The get_meta_sql hook is used to alter the SQL query that is used to retrieve post meta data. This hook can be used to change the way the data is ordered, or to limit the amount of data that is retrieved.

apply_filters_ref_array( 'get_meta_sql', string[] $sql, array $queries, string $type, string $primary_table, string $primary_id_column, object $context ) #

Filters the meta query’s generated SQL.


Parameters

$sql

(string[])Array containing the query's JOIN and WHERE clauses.

$queries

(array)Array of meta queries.

$type

(string)Type of meta. Possible values include but are not limited to 'post', 'comment', 'blog', 'term', and 'user'.

$primary_table

(string)Primary table.

$primary_id_column

(string)Primary column ID.

$context

(object)The main query object that corresponds to the type, for example a WP_Query, WP_User_Query, or WP_Site_Query.


Top ↑

Source

File: wp-includes/class-wp-meta-query.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.