On this page
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
$sqlstring[]-
Array containing the query's JOIN and WHERE clauses.
$queriesarray-
Array of meta queries.
$typestring-
Type of meta. Possible values include but are not limited to
'post','comment','blog','term', and'user'. $primary_tablestring-
Primary table.
$primary_id_columnstring-
Primary column ID.
$contextobject-
The main query object that corresponds to the type, for example a
WP_Query,WP_User_Query, orWP_Site_Query.
Source
File: wp-includes/class-wp-meta-query.php. View all references
return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );
Related
Used By
| Used By | Description |
|---|---|
| WP_Meta_Query::get_sql() wp-includes/class-wp-meta-query.php | Generates SQL clauses to be appended to a main query. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/get_meta_sql