Ticket #34195: 34195.deprecate.get_terms_fields.taxonomy-functions.php.patch
| File 34195.deprecate.get_terms_fields.taxonomy-functions.php.patch, 1.8 KB (added by , 10 years ago) |
|---|
-
wp-includes/taxonomy-functions.php
1373 1373 * parameter alone. 1374 1374 * 1375 1375 * Use of this filter can result in unpredictable behavior, and is not recommended. 1376 * If using this filter, you should also consider using 'get_terms_fields_terms' to 1377 * arrange the output accordingly. 1376 1378 * 1377 1379 * @since 2.8.0 1378 1380 * … … 1380 1382 * @param array $args An array of term query arguments. 1381 1383 * @param array $taxonomies An array of taxonomies. 1382 1384 */ 1385 if ( has_filter( 'get_terms_fields' ) ) { 1386 _deprecated_function( 'get_terms_fields ' . __( 'hook' ), '4.4.0', 'get_terms ' . __( 'hook' ) ) 1387 } 1383 1388 $fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $args, $taxonomies ) ); 1384 1389 1385 1390 $join .= " INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id"; … … 1485 1490 foreach ( $terms as $term ) { 1486 1491 $_terms[ $term->term_id ] = $term->slug; 1487 1492 } 1493 } else { 1494 1495 /** 1496 * Filter the terms to arrange the return accordingly. 1497 * 1498 * Field lists modified using this filter will only modify the term fields returned 1499 * by the function when the `$fields` parameter set to a custom value different from 1500 * default values. 1501 * 1502 * Use of this filter can result in unpredictable behavior, and is not recommended. 1503 * 1504 * @since 4.4.0 1505 * 1506 * @param array $_terms An array of terms to return. 1507 * @param string $_fields Current fields parameter. 1508 * @param array $args An array of term query arguments. 1509 * @param array $taxonomies An array of taxonomies. 1510 */ 1511 $_terms = apply_filters( 'get_terms_fields_terms', $_terms, $_fields, $args, $taxonomies ); 1488 1512 } 1489 1513 1490 1514 if ( ! empty( $_terms ) ) {