meta_query_find_compatible_table_alias
Filter HookDescription
Filters the table alias identified as compatible with the current clause.Hook Information
File Location |
wp-includes/class-wp-meta-query.php
View on GitHub
|
Hook Type | Filter |
Line Number | 873 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|false
|
$alias
|
Table alias, or false if none was found. |
array
|
$clause
|
First-order query clause. |
array
|
$parent_query
|
Parent of $clause. |
WP_Meta_Query
|
$query
|
WP_Meta_Query object. |
Usage Examples
Basic Usage
<?php
// Hook into meta_query_find_compatible_table_alias
add_filter('meta_query_find_compatible_table_alias', 'my_custom_filter', 10, 4);
function my_custom_filter($alias, $clause, $parent_query, $query) {
// Your custom filtering logic here
return $alias;
}
Source Code Context
wp-includes/class-wp-meta-query.php:873
- How this hook is used in WordPress core
<?php
868 * @param string|false $alias Table alias, or false if none was found.
869 * @param array $clause First-order query clause.
870 * @param array $parent_query Parent of $clause.
871 * @param WP_Meta_Query $query WP_Meta_Query object.
872 */
873 return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
874 }
875
876 /**
877 * Checks whether the current query has any OR relations.
878 *
PHP Documentation
<?php
/**
* Filters the table alias identified as compatible with the current clause.
*
* @since 4.1.0
*
* @param string|false $alias Table alias, or false if none was found.
* @param array $clause First-order query clause.
* @param array $parent_query Parent of $clause.
* @param WP_Meta_Query $query WP_Meta_Query object.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/class-wp-meta-query.php
Related Hooks
Related hooks will be displayed here in future updates.