用于生成类别下拉列表的弃用方法。

原型

dropdown_cats( int $optionall = 1, string $all = 'All', string $orderby = 'ID', string $order = 'asc', int $show_last_update, int $show_count, int $hide_empty = 1, bool $optionnone = false, int $selected, int $exclude )

参数

$optionall (int) (Optional)

$all (string) (Optional)

$orderby (string) (Optional)

$order (string) (Optional)

$show_last_update (int) (Required)

$show_count (int) (Required)

$hide_empty (int) (Optional)

$optionnone (bool) (Optional)

$selected (int) (Required)

$exclude (int) (Required)

返回值

(string)  

源文件

路径:wp-includes/deprecated.php

<?php
...
function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
		$show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,
		$selected = 0, $exclude = 0) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_dropdown_categories()' );
	$show_option_all = '';
	if ( $optionall )
		$show_option_all = $all;
	$show_option_none = '';
	if ( $optionnone )
		$show_option_none = __('None');
	$vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',
					'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');
	$query = add_query_arg($vars, '');
	return wp_dropdown_categories($query);
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/dropdown_cats/