[wp-hackers] Need A Hook (or advice)

Garett Harnish garett at harnish.ca
Wed Mar 1 16:57:13 GMT 2006


Mark Jaquith wrote:
> In any case, you can use the wp_list_pages hook to do something like this:
>> function add_garetts_link($text) {
>>     return $text . '<li class="page_item"><a href="' . 
>> get_garetts_page_link() . '" title="Garett's Title">Link Text</a></li>';
>> }
>>
>> add_filter('wp_list_pages', 'add_garetts_link', 50); // high number so 
>> that other plugins get to have their way first

That's brilliant.  A filter hook, I hadn't thought of that.  It is 
exactly what I'm looking for.   Thank you.

 > If you need the URI to look pretty, you have a lot
> more coding to do as you need to add a rewrite rule, and have the link 
> generate the fancy version only if rewrite rules are being used, etc.

I'm not really concerned about the URI looking pretty, just that the end 
user doesn't have to do anything to make the page appear.

Is there a full list of hooks around?  I couldn't find anything to do 
with wp_list_pages on the Codex ... or does every function that returns 
output have a filter/hook attached to it?

--
Garett


More information about the wp-hackers mailing list