Avoid var name conflict in _get_meta_sql(). Fixes type var passed to get_meta_sql filter. Props Rahe, nacin. fixes #16825 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17530 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8cd811538e
commit
42e432bd94
@ -368,19 +368,19 @@ function update_meta_cache($meta_type, $object_ids) {
|
|||||||
* Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'.
|
* Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'.
|
||||||
* Default: 'CHAR'
|
* Default: 'CHAR'
|
||||||
*
|
*
|
||||||
* @param string $meta_type
|
* @param string $type Type of meta
|
||||||
* @param string $primary_table
|
* @param string $primary_table
|
||||||
* @param string $primary_id_column
|
* @param string $primary_id_column
|
||||||
* @param object $context (optional) The main query object
|
* @param object $context (optional) The main query object
|
||||||
* @return array( 'join' => $join_sql, 'where' => $where_sql )
|
* @return array( 'join' => $join_sql, 'where' => $where_sql )
|
||||||
*/
|
*/
|
||||||
function _get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_column, $context = null ) {
|
function _get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $context = null ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
if ( ! $meta_table = _get_meta_table( $meta_type ) )
|
if ( ! $meta_table = _get_meta_table( $type ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$meta_id_column = esc_sql( $meta_type . '_id' );
|
$meta_id_column = esc_sql( $type . '_id' );
|
||||||
|
|
||||||
$join = '';
|
$join = '';
|
||||||
$where = '';
|
$where = '';
|
||||||
@ -442,7 +442,7 @@ function _get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_col
|
|||||||
$where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
|
$where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
|
||||||
}
|
}
|
||||||
|
|
||||||
return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context ) );
|
return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $type, $primary_table, $primary_id_column, &$context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user