WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 21 months ago

#49260 new enhancement

Add filter to change wp_dropdown_categories default arguments

Reported by: jignashu Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.2
Component: Taxonomy Keywords:
Focuses: Cc:

Description

We can add new filter on wp-includes/category-template.php file.
Function name : wp_dropdown_categories($args)
in this function, we can add one filter to change the default argument values.

Change History (3)

#1 @jignashu
21 months ago

  • Component changed from General to Taxonomy

#2 @SergeyBiryukov
21 months ago

  • Focuses accessibility removed

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Could you share a use case for this filter?

Just noting that wp_dropdown_users_args filter was introduced in [34692] / #19867.

At a glance, it would probably make sense to do the same for wp_dropdown_categories() and wp_dropdown_pages().

Maybe for wp_dropdown_languages() too, but it's mostly used in the admin, so I guess I'd skip it for now, unless there's an actual use case for a filter there.

#3 @jignashu
21 months ago

Yes, we can add filter on wp_dropdown_pages(), wp_dropdown_languages() too.

The scenario is nothing but if some plugin calling those functions and not added filter on their plugins to change the arguments then we can use WordPress default filter to change those values.

Note: See TracTickets for help on using tickets.