Opened 6 years ago
Last modified 6 years ago
#44343 new feature request
Add filter hook for parent dropdown arguments
Reported by: | obiplabon | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch 2nd-opinion |
Focuses: | administration | Cc: |
Attachments (2)
Change History (7)
#2
follow-up:
↓ 3
@
6 years ago
- Version trunk deleted
Thanks for the ticket and the patch @obiplabon.
That seems to make sense to have it easily filterable too, though I think one could use the get_terms_args
filter, with a doing_action()
/did_action()
check for the corresponding ajax action hook, as a workaround.
Some notes regarding 44343.diff:
- Missing
@since
in the filter's docblock. - It would be nice to have the description for the input
@param
. - It would be nice to have the default elements of the
$args
input documented. - Would we ever need to only change the ajax output of
wp_dropdown_categories()
? What about using the existingpost_edit_category_parent_dropdown_args
filter, for the ajaxwp_dropdown_categories()
arguments, as well, since those two outputs are so related? In that case, we can refer to the existing inline filter documentation. Here I'm assuming the ajax callback is only used for the post edit screen (we might have to verify that). Thoughts?
I attached the screenshot 1528614160.png, just in case the external link goes down or changes.
#3
in reply to:
↑ 2
@
6 years ago
Hi birgire
Thanks for your valuable review. It's my first patch that's why I was a bit confused about what to add and what to not. I'll add those stuffs from now on.
Thanks for the workaround. I didn't even think about that, somehow slipped my mind.
post_edit_category_parent_dropdown_args
works only when the page reloads, this filter hook doesn't work for ajax call. And yes, the ajax callback is only used for the post edit screen.
When we add hierarchical terms from post edit screen the dropdown changes and there's no convenient filter hook to change the wp_dropdown_categories()
arguments. It'd be better if there's a easy filter hook.
What do you think? Should I upload an updated patch?
Thanks
#4
@
6 years ago
- Keywords 2nd-opinion added
It might be good to have a second opinion regarding reusing the post_edit_category_parent_dropdown_args
filter in ajax, before writing the patch.
At the moment I would favor reusing that filter for ajax too, instead of introducing a new one.
So I tag the question for that.
Patch for this feature