wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
wp_dropdown_cats is deprecated since version 3.0.0!
Alternative: Ver página de detalhe para wp_dropdown_categories »" href="https://pt.wpseek.com/function/wp_dropdown_categories/">wp_dropdown_categories()
Alternative: Ver página de detalhe para wp_dropdown_categories »" href="https://pt.wpseek.com/function/wp_dropdown_categories/">wp_dropdown_categories()
wp_dropdown_cats › WordPress Function
Desde1.2.0
Obsoleto3.0.0
› wp_dropdown_cats ( $current_cat = 0, $current_parent = 0, $category_parent = 0, $level = 0, $categories = 0 )
| Parâmetros: (5) |
|
| Ver: | |
| Retorna: |
|
| Definido em: |
|
| Codex: |
Legacy function used for generating a categories drop-down control.
Funções relacionadas: dropdown_cats, wp_dropdown_pages, wp_dropdown_categories, wp_dropdown_roles, wp_dropdown_users
Fonte
function wp_dropdown_cats( $current_cat = 0, $current_parent = 0, $category_parent = 0, $level = 0, $categories = 0 ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );
if (!$categories )
$categories = get_categories( array('hide_empty' => 0) );
if ( $categories ) {
foreach ( $categories as $category ) {
if ( $current_cat != $category->term_id && $category_parent == $category->parent) {
$pad = str_repeat( '– ', $level );
$category->name = esc_html( $category->name );
echo "\n\t<option value='$category->term_id'";
if ( $current_parent == $category->term_id )
echo " selected='selected'";
echo ">$pad$category->name</option>";
wp_dropdown_cats( $current_cat, $current_parent, $category->term_id, $level +1, $categories );
}
}
} else {
return false;
}
}