[wp-trac] [WordPress Trac] #40666: allow arbitrary HTML attributes on <a> produced by Walker_Category
WordPress Trac
noreply at wordpress.org
Thu Mar 21 10:22:37 UTC 2019
#40666: allow arbitrary HTML attributes on <a> produced by Walker_Category
---------------------------------------------+-----------------------------
Reporter: pbiron | Owner: SergeyBiryukov
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 5.2
Component: Taxonomy | Version:
Severity: normal | Resolution:
Keywords: has-patch commit needs-dev-note | Focuses: accessibility
---------------------------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [comment:1 pbiron]:
> To the best of my knowledge, in core `Walker_Category` is only used by
`wp_list_categories()` and `wp_list_categories()` is only used by
`WP_Widget_Categories`.
>
> As a result, I'm not sure that the name of new filter introduced in my
patch (`category_menu_link_attributes`) is appropriate. I named it that
to mirror the new filter introduced in #40359...which was named after the
existing filter in `Walker_Nav_Menu`.
>
> I'd like some feedback on the naming (and inline docs) for this new
filter.
In hindsight, `page_menu_link_attributes` could probably have been called
`page_list_link_attributes`, as `Walker_Page` is only used directly in
`wp_list_pages()`, via `walk_page_tree()`.
However, `wp_list_pages()` is also used in `wp_page_menu()`, so
`page_menu_link_attributes` seemed to make sense in that regard.
For categories, I think `category_list_link_attributes` would make sense
without deviating too much from the existing naming of
`page_menu_link_attributes` and `nav_menu_link_attributes`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40666#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list