From 2e39930d71260702f0451ca567e4d7bebf07f785 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 30 May 2020 10:06:49 +0000 Subject: [PATCH] Docs: Adjust the documentation for the new `ID` alias in `get_term_by()` for consistency with `get_user_by()`. Follow-up to [47865]. See #45163. git-svn-id: https://develop.svn.wordpress.org/trunk@47870 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index a53377a415..1693bad778 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -913,12 +913,12 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { * @since 2.3.0 * @since 4.4.0 `$taxonomy` is optional if `$field` is 'term_taxonomy_id'. Converted to return * a WP_Term object if `$output` is `OBJECT`. - * @since 5.5.0 ID is an alias of id. + * @since 5.5.0 Added 'ID' as an alias of 'id' for the `$field` parameter. * * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param. * - * @param string $field Either 'slug', 'name', 'id' (term_id or ID), or 'term_taxonomy_id' - * @param string|int $value Search for this term value + * @param string $field Either 'slug', 'name', 'id' or 'ID' (term_id), or 'term_taxonomy_id'. + * @param string|int $value Search for this term value. * @param string $taxonomy Taxonomy name. Optional, if `$field` is 'term_taxonomy_id'. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to * a WP_Term object, an associative array, or a numeric array, respectively. Default OBJECT. @@ -942,7 +942,7 @@ function get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter } } - if ( 'id' === $field || 'term_id' === $field || 'ID' === $field ) { + if ( 'id' === $field || 'ID' === $field || 'term_id' === $field ) { $term = get_term( (int) $value, $taxonomy, $output, $filter ); if ( is_wp_error( $term ) || null === $term ) { $term = false;