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/nav-menu.php

    r45656 r45723  
    598598function wp_get_nav_menus( $args = array() ) {
    599599    $defaults = array(
     600        'taxonomy'   => 'nav_menu',
    600601        'hide_empty' => false,
    601602        'orderby'    => 'name',
     
    613614     * @param array $args  An array of arguments used to retrieve menu objects.
    614615     */
    615     return apply_filters( 'wp_get_nav_menus', get_terms( 'nav_menu', $args ), $args );
     616    return apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args );
    616617}
    617618
     
    728729            foreach ( array_keys( $terms ) as $taxonomy ) {
    729730                get_terms(
    730                     $taxonomy,
    731731                    array(
     732                        'taxonomy'     => $taxonomy,
    732733                        'include'      => $terms[ $taxonomy ],
    733734                        'hierarchical' => false,
Note: See TracChangeset for help on using the changeset viewer.