WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/03/2019 03:34:54 AM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r45590 r45723  
    185185        );
    186186
    187         $prepared_args = array();
     187        $prepared_args = array( 'taxonomy' => $this->taxonomy );
    188188
    189189        /*
     
    250250            $prepared_args['object_ids'] = $prepared_args['post'];
    251251        } else {
    252             $query_result = get_terms( $this->taxonomy, $prepared_args );
     252            $query_result = get_terms( $prepared_args );
    253253        }
    254254
Note: See TracChangeset for help on using the changeset viewer.