On this page
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 ): string
This function has been deprecated. Use wp_dropdown_categories() instead.
Deprecated method for generating a drop-down of categories.
Description
See also
Parameters
$optionallint Optional-
Default:
1 $allstring Optional-
Default:
'All' $orderbystring Optional-
Default:
'ID' $orderstring Optional-
Default:
'asc' $show_last_updateint Required$show_countint Required$hide_emptyint Optional-
Default:
1 $optionnonebool Optional-
Default:
false $selectedint Required$excludeint Required
Return
string
Source
File: wp-includes/deprecated.php. View all references
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);
}
Related
Uses
| Uses | Description |
|---|---|
| wp_dropdown_categories() wp-includes/category-template.php | Displays or retrieves the HTML dropdown list of categories. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| add_query_arg() wp-includes/functions.php | Retrieves a modified URL query string. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Use wp_dropdown_categories() |
| 0.71 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/dropdown_cats