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

dropdown_cats() WordPress Function

The dropdown_cats() function in Wordpress allows you to create a drop-down list of categories. This is useful if you want to allow your users to select a category from a list.

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.


Description

Top ↑

See also


Top ↑

Parameters

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


Top ↑

Return

(string)


Top ↑

Source

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


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Use wp_dropdown_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