You can do like this
add_filter( 'wp_dropdown_cats', 'add_yet_another_option', 10, 2 );
function add_yet_another_option( $output, $r ){
$output = str_replace( '</select>','',$output ); // remove closing select tag
$output .= '<option class="level-0" value="some-value"> Some Custom Options </option>'; // custom option.
$output .= '</select>'; // add closing select tag
return $output;
}
But why would someone put custom option on the category dropdown ?
Related Posts:
- Dropdown with category selection
- Saving two categories from two dropdowns in front end posting form
- Get id of category from drop down menu
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- How to retain the values from dropdown category lists after wrong form submission?
- Help with multiple dropdown tags search
- How to use wp_category_checklist()?
- wp_dropdown_categories and custom taxonomy + custom post type
- How to provide value for ‘selected’ on wp_dropdown_categories() for ‘multiple’ options
- Additional form options based on category selected not working
- wp_dropdown_categories() scripts working erratically on sidebar
- How to use an array of categories as a dropdown?
- How do I display only two categories Instead of displaying all categories
- Dropdown Categories used in form shows no results when all is selected
- Trying to get variables in hacked category dropdown
- wp_list_categories walker without links on categories that have subcategories (to make a nested dropdown menu)
- Filter posts by categories ajax is showing nothing
- WordPress Customizer: Dropdown with Category output
- Filter By Category Dropdown List With Custom Taxonomies
- A dropdown with checklist
- Wp Dropdown Category Not Show Current As Title
- wp_dropdown_categories initial value
- Exclude category from drop down list form
- Trying to get categories and sub-category listing
- Get_term_meta() always returns false
- Woocommerce Category Sort Dropdown
- custom browse by
- Get category fixed in dropdown browse categories
- Categories dropdown with all values selected using wp_dropdown_categories
- add custom option to get_categories dropdown
- Taxonomy for custom post type not found
- Form Value of drop down category + Translation of ‘show option none’
- How to check if I’m on the last page of posts?
- Category page doesn’t use category.php, instead it redirects to homepage
- wp_update_nav_menu_item() to insert categories
- How to exclude uncategorized from permalink structure /%category%/%postname%/
- Redirecting specific category posts to subdomain
- How can I create a loop to build slides based on multiple categories using Coda Slider
- Best and Cleanest way to remove /category/ from category permalinks? [duplicate]
- Categories list loop – add separator every year
- How would you create a “weekly” archive?
- wp_list_categories to show list of categories and the description
- What type of page should i use? static page or category page? and what’s the difference? [closed]
- Filtering by Category doesnt paginate correctly on the backend
- Direct link to category?
- How to modify category.php to list posts alphabetically?
- Categories vs. Page Site Organization
- Sorting posts by season
- Getting URL of archive (category) page
- Strip a word from wp_list_categories
- List all the categories with or without post
- How to hide category description in the subpages? [closed]
- SQL to migrate post types to taxonomy
- WordPress Post # of # filtered by category slug
- wordpress multisite… collect all posts on main blog – exclude category?
- Automatically redirect a page to a category that share the same slug
- How to put an array in is_category
- How do I add Category Body Classes to Admin?
- get_posts() from parent category only using a shortcode
- Edit tag_id in category pages of dashboard
- wp_list_categories with category description
- How to restrict the amount of categories/post tags/terms for a post type post
- More efficient way to list posts by category [duplicate]
- Query posts by views on category page
- Using in ‘category_name’ in ‘$query->set();’?
- Change appearance based on category but post is in two main categories
- Custom Page Template Category loop not functioning correctly
- Pagination for a category
- Custom url structure – pages under a custom post type
- How to correctly display category’s slug as a class?
- prefix to post permalinks without affecting category permas
- What is the best way to add an advanced / intermediate / beginner tag to a post
- How to add tags under categories
- How to get specific (grand parent) category of current post?
- How to add commentary types or category for a post
- How to change current category to another in wordpress
- show thumbnail for subcategory wordpress
- How to remove parent category from child category url using wordpress rewrite rule?
- Hide a category/posts from the homepage in wp
- How to modify custom category field from front end?
- Remove “category” from permalink with add_rewrite_rule
- Next and previous links category infinite loop
- How to hook into creating a category?
- show only terms from parent category
- show posts in archive page based on selected catagory
- How to display total views of all posts of one category?
- Get the categorie name of Event Organiser plugin [closed]
- How to show “category” name?
- Display the category name of a post that is in two different categories
- filter single_cat_title avoiding the breadcrumbs
- htaccess redirect for all categories converted to tags now showing 404
- Category page with gallery for each post
- (WordPress) How to get custom taxonomy parent name?
- How to make a drop down menu with categories
- Search functionality with multiple categories
- Make a menu visible for a single category and it’s content
- WordPress Loop Prob
- WooCommerce category display in custom page
- How to define category ID in an array?
- How to add custom prefix before category base for category page URL?