Add filter hooks to page_menu/list_pages hyperlinks
|Reported by:||Sam_a||Owned by:|
Patch adds 2 new filter hooks, page_anchor_contents, and page_anchor_attributes, to let plugin/theme authors filter the hyperlinks printed by wp_page_menu() and wp_list_pages() -- substituting a menu label different from the Page's title, changing the title attribute, or adding new attributes, for example.
It's possible to do this now by reading the whole output from the wp_list_pages filter, using regexp to find the Page you want, retrieving the post data, and then doing a regexp replace, but we can make it a lot simpler.
The new hooks follow the existing page_css_class filter hook and pass the current $page object to the filter function, so per-page filtering is super easy.
Tested successfully in 2.8.4 and trunk.