From 3bdcf368884d88f1863ca1c2243fa5b385ca1cb5 Mon Sep 17 00:00:00 2001
From: nacin <nacin@1a063a9b-81f0-0310-95a4-ce76da25c4cd>
Date: Thu, 18 Mar 2010 20:17:15 +0000
Subject: [PATCH] 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

git-svn-id: http://svn.automattic.com/wordpress/trunk@13754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-admin/options-writing.php      | 2 +-
 wp-includes/category-template.php | 7 +++++++
 wp-includes/category.php          | 5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php
index 3059cf2a06..dbcc1e59a2 100644
--- a/wp-admin/options-writing.php
+++ b/wp-admin/options-writing.php
@@ -52,7 +52,7 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_category', 'o
 <th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th>
 <td>
 <?php
-wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'type' => 'link'));
+wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'taxonomy' => 'link_category'));
 ?>
 </td>
 </tr>
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index a000988554..cb746d0a7b 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -318,6 +318,7 @@ function category_description( $category = 0 ) {
  *     'id' (string) - The ID attribute value for select element. Defaults to name if omitted.
  *     'class' (string) - The class attribute value for select element.
  *     'selected' (int) - Which category ID is selected.
+ *     'taxonomy' (string) - The name of the taxonomy to retrieve. Defaults to category.
  *
  * The 'hierarchical' argument, which is disabled by default, will override the
  * depth argument, unless it is true. When the argument is false, it will
@@ -345,6 +346,12 @@ function wp_dropdown_categories( $args = '' ) {
 
 	$defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
 
+	// Back compat.
+	if ( isset( $args['type'] ) && 'link' == $args['type'] ) {
+		_deprecated_argument( __FUNCTION__, '3.0', '' );
+		$args['taxonomy'] = 'link_category';
+	}
+
 	$r = wp_parse_args( $args, $defaults );
 
 	if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
diff --git a/wp-includes/category.php b/wp-includes/category.php
index ee3d9432ee..1f66518536 100644
--- a/wp-includes/category.php
+++ b/wp-includes/category.php
@@ -42,8 +42,11 @@ function &get_categories( $args = '' ) {
 
 	$taxonomy = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );
 
-	if ( isset($args['type']) && 'link' == $args['type'] ) //Back compat
+	// Back compat
+	if ( isset($args['type']) && 'link' == $args['type'] ) {
+		_deprecated_argument( __FUNCTION__, '3.0', '' );
 		$taxonomy = $args['taxonomy'] = 'link_category';
+	}
 
 	$categories = (array) get_terms( $taxonomy, $args );