列出类别。

原型

list_cats( int $optionall = 1, string $all = 'All', string $sort_column = 'ID', string $sort_order = 'asc', string $file = '', bool $list = true, int $optiondates, int $optioncount, int $hide_empty = 1, int $use_desc_for_title = 1, bool $children = false, int $child_of, int $categories, int $recurse, string $feed = '', string $feed_image = '', string $exclude = '', bool $hierarchical = false )

参数

$optionall (int) (Optional)

$all (string) (Optional)

$sort_column (string) (Optional)

$sort_order (string) (Optional)

$file (string) (Optional)

$list (bool) (Optional)

$optiondates (int) (Required)

$optioncount (int) (Required)

$hide_empty (int) (Optional)

$use_desc_for_title (int) (Optional)

$children (bool) (Optional)

$child_of (int) (Required)

$categories (int) (Required)

$recurse (int) (Required)

$feed (string) (Optional)

$feed_image (string) (Optional)

$exclude (string) (Optional)

$hierarchical (bool) (Optional)

返回值

(false|null)  

源文件

路径:wp-includes/deprecated.php

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
...
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
				   $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );

	$query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children',
		'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');
	return wp_list_cats($query);
}

...
?>

其他

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