meta_query_find_compatible_table_alias

Filters the table alias identified as compatible with the current clause.

Description

apply_filters( 'meta_query_find_compatible_table_alias', (string|bool) $alias, (array) $clause, (array) $parent_query, (object) $instance ); 

Parameters (4)

0. $alias (string|bool)
Table alias, or false if none was found.
1. $clause (array)
First-order query clause.
2. $parent_query (array)
Parent of $clause.
3. $instance (object)
WP_Meta_Query object.

Usage

To run the hook, copy the example below.
  1. $alias = apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $instance ); 
  2.  
  3. if ( !empty( $alias ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the meta_query_find_compatible_table_alias callback 
  2. function filter_meta_query_find_compatible_table_alias( $alias, $clause, $parent_query, $instance ) { 
  3. // make filter magic happen here... 
  4. return $alias
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'meta_query_find_compatible_table_alias', 'filter_meta_query_find_compatible_table_alias', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'meta_query_find_compatible_table_alias', 'filter_meta_query_find_compatible_table_alias', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/class-wp-meta-query.php  
  1. return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this ) ;