Make WordPress Core

Changeset 13097


Ignore:
Timestamp:
02/13/2010 07:42:02 AM (15 years ago)
Author:
nacin
Message:

Deprecate old category admin template functions. Deprecate dropdown_categories(), dropdown_link_categories(), wp_dropdown_cats() in favor of wp_category_checklist, wp_link_category_checklist, wp_dropdown_categories. See #11388

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/deprecated.php

    r12871 r13097  
    5555}
    5656
     57/**
     58 * {@internal Missing Short Description}}
     59 *
     60 * @since unknown
     61 * @deprecated unknown
     62 * @deprecated Use wp_category_checklist()
     63 * @see wp_category_checklist()
     64 *
     65 * @param unknown_type $default
     66 * @param unknown_type $parent
     67 * @param unknown_type $popular_ids
     68 */
     69function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
     70    _deprecated_function( __FUNCTION__, '0.0', 'wp_category_checklist()' );
     71    global $post_ID;
     72    wp_category_checklist( $post_ID );
     73}
     74
     75/**
     76 * {@internal Missing Short Description}}
     77 *
     78 * @since unknown
     79 * @deprecated unknown
     80 * @deprecated Use wp_link_category_checklist()
     81 * @see wp_link_category_checklist()
     82 *
     83 * @param unknown_type $default
     84 */
     85function dropdown_link_categories( $default = 0 ) {
     86    _deprecated_function( __FUNCTION__, '0.0', 'wp_link_category_checklist()' );
     87    global $link_id;
     88    wp_link_category_checklist( $link_id );
     89}
     90
     91/**
     92 * {@internal Missing Short Description}}
     93 *
     94 * @since unknown
     95 * @deprecated 3.0.0
     96 * @deprecated Use wp_dropdown_categories()
     97 * @see wp_dropdown_categories()
     98 *
     99 * @param unknown_type $currentcat
     100 * @param unknown_type $currentparent
     101 * @param unknown_type $parent
     102 * @param unknown_type $level
     103 * @param unknown_type $categories
     104 * @return unknown
     105 */
     106function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
     107    _deprecated_function( __FUNCTION__, '3.0', 'wp_dropdown_categories()' );
     108    if (!$categories )
     109        $categories = get_categories( array('hide_empty' => 0) );
     110
     111    if ( $categories ) {
     112        foreach ( $categories as $category ) {
     113            if ( $currentcat != $category->term_id && $parent == $category->parent) {
     114                $pad = str_repeat( '– ', $level );
     115                $category->name = esc_html( $category->name );
     116                echo "\n\t<option value='$category->term_id'";
     117                if ( $currentparent == $category->term_id )
     118                    echo " selected='selected'";
     119                echo ">$pad$category->name</option>";
     120                wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
     121            }
     122        }
     123    } else {
     124        return false;
     125    }
     126}
     127
    57128?>
  • trunk/wp-admin/includes/template.php

    r13086 r13097  
    235235 *
    236236 * @since unknown
    237  * @deprecated Use {@link wp_link_category_checklist()}
    238  * @see wp_link_category_checklist()
    239  *
    240  * @param unknown_type $default
    241  * @param unknown_type $parent
    242  * @param unknown_type $popular_ids
    243  */
    244 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
    245     global $post_ID;
    246     wp_category_checklist($post_ID);
    247 }
    248 
    249 /**
    250  * {@internal Missing Short Description}}
    251  *
    252  * @since unknown
    253237 */
    254238class Walker_Category_Checklist extends Walker {
     
    419403    }
    420404    return $popular_ids;
    421 }
    422 
    423 /**
    424  * {@internal Missing Short Description}}
    425  *
    426  * @since unknown
    427  * @deprecated Use {@link wp_link_category_checklist()}
    428  * @see wp_link_category_checklist()
    429  *
    430  * @param unknown_type $default
    431  */
    432 function dropdown_link_categories( $default = 0 ) {
    433     global $link_id;
    434 
    435     wp_link_category_checklist($link_id);
    436405}
    437406
     
    23482317 * @since unknown
    23492318 *
    2350  * @param unknown_type $currentcat
    2351  * @param unknown_type $currentparent
    2352  * @param unknown_type $parent
    2353  * @param unknown_type $level
    2354  * @param unknown_type $categories
    2355  * @return unknown
    2356  */
    2357 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
    2358     if (!$categories )
    2359         $categories = get_categories( array('hide_empty' => 0) );
    2360 
    2361     if ( $categories ) {
    2362         foreach ( $categories as $category ) {
    2363             if ( $currentcat != $category->term_id && $parent == $category->parent) {
    2364                 $pad = str_repeat( '&#8211; ', $level );
    2365                 $category->name = esc_html( $category->name );
    2366                 echo "\n\t<option value='$category->term_id'";
    2367                 if ( $currentparent == $category->term_id )
    2368                     echo " selected='selected'";
    2369                 echo ">$pad$category->name</option>";
    2370                 wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
    2371             }
    2372         }
    2373     } else {
    2374         return false;
    2375     }
    2376 }
    2377 
    2378 /**
    2379  * {@internal Missing Short Description}}
    2380  *
    2381  * @since unknown
    2382  *
    23832319 * @param unknown_type $meta
    23842320 */
Note: See TracChangeset for help on using the changeset viewer.