wp_list_cats

函式
wp_list_cats ( $args = '' )
引數
  • (string|array) $args
    Required:
    Default: (empty)
返回值
  • (null|string|false)
相關
  • wp_list_categories()
定義位置
相關方法
list_catswp_list_authorswp_list_categorieswp_list_pageswp_list_comments
引入
1.2.0
棄用
2.1.0

wp_list_cats: 這是wp_list_categories的別名,自WordPress 2.1版本以來,它已經被棄用了。它被用來檢索和顯示一個類別的列表,與wp_list_categories很相似。

列出分類目錄。

function wp_list_cats($args = '') {
	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );

	$parsed_args = wp_parse_args( $args );

	// Map to new names.
	if ( isset($parsed_args['optionall']) && isset($parsed_args['all']))
		$parsed_args['show_option_all'] = $parsed_args['all'];
	if ( isset($parsed_args['sort_column']) )
		$parsed_args['orderby'] = $parsed_args['sort_column'];
	if ( isset($parsed_args['sort_order']) )
		$parsed_args['order'] = $parsed_args['sort_order'];
	if ( isset($parsed_args['optiondates']) )
		$parsed_args['show_last_update'] = $parsed_args['optiondates'];
	if ( isset($parsed_args['optioncount']) )
		$parsed_args['show_count'] = $parsed_args['optioncount'];
	if ( isset($parsed_args['list']) )
		$parsed_args['style'] = $parsed_args['list'] ? 'list' : 'break';
	$parsed_args['title_li'] = '';

	return wp_list_categories($parsed_args);
}

常見問題

FAQs
檢視更多 >