From 1e3c221043965e372d268a2a7362430b918d111c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 27 Dec 2022 12:23:15 +0000 Subject: [PATCH] Docs: Remove the legacy example of passing a taxonomy to `get_terms()`. As of WordPress 4.5, taxonomies should be passed to `get_terms()` via the `taxonomy` argument in the `$args` array: {{{ $terms = get_terms( array( 'taxonomy' => 'post_tag', 'hide_empty' => false, ) ); }}} The legacy way of passing a taxonomy via the function's first parameter was still mentioned in the documentation, causing some confusion. This commit updates the function documentation to better highlight the currently recommended approach. Follow-up to [36614]. Props ramon-fincken, sabernhardt, SergeyBiryukov. Fixes #57380. Built from https://develop.svn.wordpress.org/trunk@55018 git-svn-id: http://core.svn.wordpress.org/trunk@54551 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 13 +++++-------- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 2c63e23b27..bd83110e3f 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1229,19 +1229,16 @@ function get_term_to_edit( $id, $taxonomy ) { * The {@see 'get_terms_orderby'} filter passes the `ORDER BY` clause for the query * along with the $args array. * - * Prior to 4.5.0, the first parameter of `get_terms()` was a taxonomy or list of taxonomies: - * - * $terms = get_terms( 'post_tag', array( - * 'hide_empty' => false, - * ) ); - * - * Since 4.5.0, taxonomies should be passed via the 'taxonomy' argument in the `$args` array: + * Taxonomy or an array of taxonomies should be passed via the 'taxonomy' argument + * in the `$args` array: * * $terms = get_terms( array( - * 'taxonomy' => 'post_tag', + * 'taxonomy' => 'post_tag', * 'hide_empty' => false, * ) ); * + * Prior to 4.5.0, taxonomy was passed as the first parameter of `get_terms()`. + * * @since 2.3.0 * @since 4.2.0 Introduced 'name' and 'childless' parameters. * @since 4.4.0 Introduced the ability to pass 'term_id' as an alias of 'id' for the `orderby` parameter. diff --git a/wp-includes/version.php b/wp-includes/version.php index d2ccf1204a..7bf9925bb9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55017'; +$wp_version = '6.2-alpha-55018'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.