^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数dropdown_cats()用法示例

Warning: This function has been deprecated. Use wp_dropdown_categories() instead.

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 )

Deprecated method for generating a drop-down of categories.

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包


描述


参数

$optionall

(int)
(Optional)

Default value: 1

$all

(string)
(Optional)

Default value: ‘All’

$orderby

(string)
(Optional)

Default value: ‘ID’

$order

(string)
(Optional)

Default value: ‘asc’

$show_last_update

(int)
(Required)

$show_count

(int)
(Required)

$hide_empty

(int)
(Optional)

Default value: 1

$optionnone

(bool)
(Optional)

Default value: false

$selected

(int)
(Required)

$exclude

(int)
(Required)


返回值

(string)


源代码

File: wp-includes/deprecated.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);
}

更新日志

Version 描述
2.1.0 Use wp_dropdown_categories()
0.71 Introduced.

相关函数

Uses

  • wp-includes/category-template.php:
    wp_dropdown_categories()
  • wp-includes/l10n.php:
    __()
  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/functions.php:
    add_query_arg()

让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈