WordPress.org

Make WordPress Core

Changeset 13754


Ignore:
Timestamp:
03/18/2010 08:17:15 PM (11 years ago)
Author:
nacin
Message:

Account for old type=link (now taxonomy=link_category) in wp_dropdown_categories(). Don't use the deprecated argument in options-writing. Sprinkle in some deprecated warnings. fixes #12630

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-writing.php

    r13750 r13754  
    5353<td>
    5454<?php
    55 wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'type' => 'link'));
     55wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'taxonomy' => 'link_category'));
    5656?>
    5757</td>
  • trunk/wp-includes/category-template.php

    r13553 r13754  
    319319 *     'class' (string) - The class attribute value for select element.
    320320 *     'selected' (int) - Which category ID is selected.
     321 *     'taxonomy' (string) - The name of the taxonomy to retrieve. Defaults to category.
    321322 *
    322323 * The 'hierarchical' argument, which is disabled by default, will override the
     
    345346
    346347    $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
     348
     349    // Back compat.
     350    if ( isset( $args['type'] ) && 'link' == $args['type'] ) {
     351        _deprecated_argument( __FUNCTION__, '3.0', '' );
     352        $args['taxonomy'] = 'link_category';
     353    }
    347354
    348355    $r = wp_parse_args( $args, $defaults );
  • trunk/wp-includes/category.php

    r13382 r13754  
    4343    $taxonomy = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );
    4444
    45     if ( isset($args['type']) && 'link' == $args['type'] ) //Back compat
     45    // Back compat
     46    if ( isset($args['type']) && 'link' == $args['type'] ) {
     47        _deprecated_argument( __FUNCTION__, '3.0', '' );
    4648        $taxonomy = $args['taxonomy'] = 'link_category';
     49    }
    4750
    4851    $categories = (array) get_terms( $taxonomy, $args );
Note: See TracChangeset for help on using the changeset viewer.