get_meta_sql
Filters the meta query's generated SQL.
Usage
add_filter( 'get_meta_sql', 'wp_kama_get_meta_sql_filter' );
/**
* Function for `get_meta_sql` filter-hook.
*
* @param string[] $sql Array containing the query's JOIN and WHERE clauses.
*
* @return string[]
*/
function wp_kama_get_meta_sql_filter( $sql ){
// filter...
return $sql;
}
- $sql(string[])
- Array containing the query's JOIN and WHERE clauses.
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
get_meta_sql
wp-includes/class-wp-meta-query.php 395
return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );