Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for more params of wp_dropdown_categories() and wp_list_categories() #68324

Open
pbiron opened this issue Dec 26, 2024 · 1 comment
Labels
[Block] Categories Affects the Categories Block [Type] Enhancement A suggestion for improvement.

Comments

@pbiron
Copy link

pbiron commented Dec 26, 2024

What problem does this address?

I've got a Categories block (with "Display as dropdown" is enabled) in the "Categories" template in a block theme I'm developing.

I have an immediate need to have the "current category" be selected when the block renders (i.e., to set the selected param passed to wp_dropdown_categories().

Additionally, I'd like to have an "All" option added to the SELECT element (i.e., to set the show_option_all param passed to wp_dropdown_categories()) which, when selected by the end-user, will send them to the "Blog Home" template.

I can imagine that others would also want a way to set other params to wp_dropdown_categories() and/or wp_list_categories(). I originally was going to use "support ALL params" in the title of this issue, but of course, I don't think there are valid use cases for being able to set params like echo, etc. Hence, the title of "support for more params...".

Related issue: #30767

What is your proposed solution?

I understand that designing a simple UI/UX for some of those params could be difficult. As a first step, it would be fine by me to add appropriate attributes for the blog and require going to the "Code Editor" to be able to set them (there is precedence for this in other blocks).

@pbiron pbiron added the [Type] Enhancement A suggestion for improvement. label Dec 26, 2024
@pbiron
Copy link
Author

pbiron commented Dec 26, 2024

I understand that designing a simple UI/UX for some of those params could be difficult. As a first step, it would be fine by me to add appropriate attributes for the blog and require going to the "Code Editor" to be able to set them (there is precedence for this in other blocks).

I guess I should give an example of this precedence ;-) Well, the "Search" block has no UI for setting the placeholder and buttonText attributes (they have to be set in the "Code Editor").

@skorasaurus skorasaurus added the [Block] Categories Affects the Categories Block label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Categories Affects the Categories Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants