Make WordPress Core

Changeset 42372


Ignore:
Timestamp:
12/04/2017 10:03:52 PM (7 years ago)
Author:
boonebgorges
Message:

category_description() should be taxonomy-agnostic.

This change reinstates the previous de facto behavior of category_description().
See [40979], [42364]. Because term_description() no longer passes $taxonomy to
get_term_field(), the parameter is no longer needed and has been deprecated.

Merges [42368] to the 4.9 branch.

Fixes #42605. See #42771.

Location:
branches/4.9
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/category-template.php

    r42371 r42372  
    11541154 *
    11551155 * @since 2.8.0
     1156 * @since 4.9.2 The `$taxonomy` parameter was deprecated.
    11561157 *
    11571158 * @param int $term Optional. Term ID. Will use global term ID by default.
    1158  * @param string $taxonomy Optional taxonomy name. Defaults to 'post_tag'.
    11591159 * @return string Term description, available.
    11601160 */
    1161 function term_description( $term = 0, $taxonomy = 'post_tag' ) {
     1161function term_description( $term = 0 ) {
    11621162    if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {
    11631163        $term = get_queried_object();
    11641164        if ( $term ) {
    1165             $taxonomy = $term->taxonomy;
    11661165            $term = $term->term_id;
    11671166        }
    11681167    }
    1169     $description = get_term_field( 'description', $term, $taxonomy );
     1168    $description = get_term_field( 'description', $term );
    11701169    return is_wp_error( $description ) ? '' : $description;
    11711170}
Note: See TracChangeset for help on using the changeset viewer.