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

wp_list_cats() WordPress Function

The wp_list_cats() function is used to list the categories for a given post. It accepts two parameters: • post_id: The ID of the post for which you want to list the categories. • args: An array of arguments. The wp_list_cats() function will return a list of the categories for the given post.

wp_list_cats( string|array $args = '' ) #

Lists categories.


Description

Top ↑

See also


Top ↑

Parameters

$args

(string|array)(Optional)

Default value: ''


Top ↑

Return

(null|string|false)


Top ↑

Source

File: wp-includes/deprecated.php

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);
}


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Use wp_list_categories()
1.2.0Introduced.

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