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

list_cats() WordPress Function

The list_cats() function is used to list all the categories on a WordPress site. This function can be used to display a list of all the categories on a WordPress site, or to display a list of specific categories.

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 ) #

Lists categories.


Description

Top ↑

See also


Top ↑

Parameters

$optionall

(int)(Optional)

Default value: 1

$all

(string)(Optional)

Default value: 'All'

$sort_column

(string)(Optional)

Default value: 'ID'

$sort_order

(string)(Optional)

Default value: 'asc'

$file

(string)(Optional)

Default value: ''

$list

(bool)(Optional)

Default value: true

$optiondates

(int)(Required)

$optioncount

(int)(Required)

$hide_empty

(int)(Optional)

Default value: 1

$use_desc_for_title

(int)(Optional)

Default value: 1

$children

(bool)(Optional)

Default value: false

$child_of

(int)(Required)

$categories

(int)(Required)

$recurse

(int)(Required)

$feed

(string)(Optional)

Default value: ''

$feed_image

(string)(Optional)

Default value: ''

$exclude

(string)(Optional)

Default value: ''

$hierarchical

(bool)(Optional)

Default value: false


Top ↑

Return

(null|false)


Top ↑

Source

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


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Use wp_list_categories()
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More