Ticket #9927: 9927.5.patch

File 9927.5.patch, 3.2 KB (added by ramiy, 3 years ago)

category_description() & tag_description() & term_description()

  • wp-includes/category-template.php

     
    286286/** 
    287287 * Retrieve category description. 
    288288 * 
    289  * @since 1.0.0 
     289 * @since 3.0.0 
    290290 * 
    291291 * @param int $category Optional. Category ID. Will use global category ID by default. 
    292292 * @return string Category description, available. 
    293293 */ 
    294 function category_description( $category = 0 ) { 
    295         return term_description( $category, 'category' ); 
     294function get_category_description( $category = 0 ) { 
     295        return get_term_description( $category, 'category' ); 
    296296} 
    297297 
    298298/** 
     
    834834/** 
    835835 * Retrieve tag description. 
    836836 * 
    837  * @since 2.8 
     837 * @since 3.0.0 
    838838 * 
    839839 * @param int $tag Optional. Tag ID. Will use global tag ID by default. 
    840840 * @return string Tag description, available. 
    841841 */ 
    842 function tag_description( $tag = 0 ) { 
    843         return term_description( $tag ); 
     842function get_tag_description( $tag = 0 ) { 
     843        return get_term_description( $tag, 'post_tag' ); 
    844844} 
    845845 
    846846/** 
    847847 * Retrieve term description. 
    848848 * 
    849  * @since 2.8 
     849 * @since 3.0.0 
    850850 * 
    851851 * @param int $term Optional. Term ID. Will use global term ID by default. 
    852852 * @return string Term description, available. 
    853853 */ 
    854 function term_description( $term = 0, $taxonomy = 'post_tag' ) { 
     854function get_term_description( $term = 0, $taxonomy = 'post_tag' ) { 
    855855        if ( !$term && ( is_tax() || is_tag() || is_category() ) ) { 
    856856                global $wp_query; 
    857857                $term = $wp_query->get_queried_object(); 
  • wp-includes/deprecated.php

     
    24462446                $user = $user->ID; 
    24472447        } 
    24482448        return get_the_author_meta( $field, $user ); 
    2449 } 
    2450  No newline at end of file 
     2449} 
     2450 
     2451/** 
     2452 * Retrieve category description. 
     2453 * 
     2454 * @since 1.0.0 
     2455 * @deprecated 3.0.0 
     2456 * @deprecated Use get_category_description($category) 
     2457 * 
     2458 * @param int $category Optional. Category ID. Will use global category ID by default. 
     2459 * @return string Category description, available. 
     2460 */ 
     2461function category_description( $category = 0 ) { 
     2462        _deprecated_function(__FUNCTION__, '3.0.0', 'get_category_description()' ); 
     2463        return get_category_description($category); 
     2464} 
     2465 
     2466/** 
     2467 * Retrieve tag description. 
     2468 * 
     2469 * @since 2.8.0 
     2470 * @deprecated 3.0.0 
     2471 * @deprecated Use get_tag_description($tag) 
     2472 * 
     2473 * @param int $tag Optional. Tag ID. Will use global tag ID by default. 
     2474 * @return string Tag description, available. 
     2475 */ 
     2476function tag_description( $tag = 0 ) { 
     2477        _deprecated_function(__FUNCTION__, '3.0.0', 'get_tag_description()' ); 
     2478        return get_tag_description($tag); 
     2479} 
     2480 
     2481/** 
     2482 * Retrieve term description. 
     2483 * 
     2484 * @since 2.8.0 
     2485 * @deprecated 3.0.0  
     2486 * @deprecated Use get_term_description($term, $taxonomy) 
     2487 * 
     2488 * @param int $term Optional. Term ID. Will use global term ID by default. 
     2489 * @return string Term description, available. 
     2490 */ 
     2491function term_description( $term = 0, $taxonomy = 'post_tag' ) { 
     2492        _deprecated_function(__FUNCTION__, '3.0.0', 'get_term_description()' ); 
     2493        return get_term_description($term, $taxonomy); 
     2494}