Taxonomy: Fix deprecated calls to get_terms().

The taxonomy should be passed as part of `$args`, rather than as its own argument.

Props sgastard, mukesh27, SergeyBiryukov.
Fixes #47819.

git-svn-id: https://develop.svn.wordpress.org/trunk@45723 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-08-03 03:34:54 +00:00
parent 2adeb5b6d5
commit 3c73c7a56f
18 changed files with 72 additions and 48 deletions
+3 -3
View File
@@ -1557,8 +1557,8 @@ class wp_xmlrpc_server extends IXR_Server {
$ambiguous_terms = array();
if ( is_taxonomy_hierarchical( $taxonomy ) ) {
$tax_term_names = get_terms(
$taxonomy,
array(
'taxonomy' => $taxonomy,
'fields' => 'names',
'hide_empty' => false,
)
@@ -2390,7 +2390,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );
}
$query = array();
$query = array( 'taxonomy' => $taxonomy->name );
if ( isset( $filter['number'] ) ) {
$query['number'] = absint( $filter['number'] );
@@ -2418,7 +2418,7 @@ class wp_xmlrpc_server extends IXR_Server {
$query['search'] = $filter['search'];
}
$terms = get_terms( $taxonomy->name, $query );
$terms = get_terms( $query );
if ( is_wp_error( $terms ) ) {
return new IXR_Error( 500, $terms->get_error_message() );