WordPress.org

Make WordPress Core

Ticket #40696: 40696.3.diff

File 40696.3.diff, 775 bytes (added by jaydeeptrivedi404, 7 weeks ago)
  • src/wp-includes/taxonomy.php

    diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
    index 370cb46ad5..f27b920188 100644
    a b function wp_count_terms( $taxonomy, $args = array() ) { 
    17031703
    17041704        $args['fields'] = 'count';
    17051705
    1706         return get_terms( $args );
     1706        $term_count = get_terms( $args );
     1707
     1708        /**
     1709         * This filter is used to filter the output of wp_count_terms function.
     1710         *
     1711         * @param array|int|WP_Error $term_count Number of terms in that taxonomy or WP_Error if the taxonomy does not exist.
     1712         * @param string             $taxonomy Taxonomy name.
     1713         * @param array              $args Count Term Query Arguments.
     1714         */
     1715        return apply_filters( 'wp_count_terms', $term_count, $taxonomy, $args );
    17071716}
    17081717
    17091718/**