Make WordPress Core


Ignore:
Timestamp:
08/21/2020 10:30:06 PM (5 years ago)
Author:
flixos90
Message:

Taxonomy: Allow for wp_count_terms( $args ) signature, making passing a taxonomy optional.

This brings wp_count_terms() in line with other taxonomy functions such as get_terms() which technically no longer require a taxonomy. Similar to the previously modified functions, no deprecation warning is triggered when using the legacy signature.

Fixes #36399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r48586 r48840  
    130130        $this->set_pagination_args(
    131131            array(
    132                 'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),
     132                'total_items' => wp_count_terms(
     133                    array(
     134                        'taxonomy' => $this->screen->taxonomy,
     135                        'search'   => $search,
     136                    )
     137                ),
    133138                'per_page'    => $tags_per_page,
    134139            )
Note: See TracChangeset for help on using the changeset viewer.