apply_filters_ref_array( 'get_meta_sql', string[] $sql, array $queries, string $type, string $primary_table, string $primary_id_column, object $context )
- Since
- 3.1.0
Filters the meta query's generated SQL.
Compatibility
- WordPress
- since 3.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
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.
Where this hook fires · 1
wp-includes/class-wp-meta-query.php:395WP_Meta_Query::get_sql()
Source code
* to 'post', 'comment', 'blog', 'term', and 'user'. * @param string $primary_table Primary table. * @param string $primary_id_column Primary column ID. * @param object $context The main query object that corresponds to the type, for * example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. */ return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) ); } /** * Generates SQL clauses to be appended to a main query. * * Called by the public WP_Meta_Query::get_sql(), this method is abstractedChangelog
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.