Here now create a WordPress category drop down menu, then this category menu display the default category list, but need a custom filed should be display in this menu list. Now i use this code for category menu.
<?php
wp_dropdown_categories( array(
'name' => $this->get_field_name( 'category' ),
'selected' => $instance["category"],
) );
?>
Here i need add a custom menu option “all”.
<select class="postform" id="widget-categoryposts[3][cat]" name="widget-categoryposts[3][cat]">
<option selected="selected" value="1" class="level-0">Uncategorized</option>
<option value="18" class="level-0">thumb</option>
<option value="19" class="level-0">snake</option>
<option value="all" class="level-0">all</option>
</select>
You can use it in this way:
Where the “all” option will appears with the text you specify in the ‘show_option_all’ element and with the value “0” in the Drop Down field.