Ticket #16825: 16825.diff
| File 16825.diff, 1.5 KB (added by nacin, 2 years ago) |
|---|
-
wp-includes/meta.php
368 368 * Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'. 369 369 * Default: 'CHAR' 370 370 * 371 * @param string $ meta_type371 * @param string $type Type of meta 372 372 * @param string $primary_table 373 373 * @param string $primary_id_column 374 374 * @param object $context (optional) The main query object 375 375 * @return array( 'join' => $join_sql, 'where' => $where_sql ) 376 376 */ 377 function _get_meta_sql( $meta_query, $ meta_type, $primary_table, $primary_id_column, $context = null ) {377 function _get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $context = null ) { 378 378 global $wpdb; 379 379 380 if ( ! $meta_table = _get_meta_table( $ meta_type ) )380 if ( ! $meta_table = _get_meta_table( $type ) ) 381 381 return false; 382 382 383 $meta_id_column = esc_sql( $ meta_type . '_id' );383 $meta_id_column = esc_sql( $type . '_id' ); 384 384 385 385 $join = ''; 386 386 $where = ''; … … 442 442 $where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value ); 443 443 } 444 444 445 return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $ meta_type, $primary_table, $primary_id_column, &$context ) );445 return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $type, $primary_table, $primary_id_column, &$context ) ); 446 446 } 447 447 448 448 /**
