[wp-hackers] Do I have to suggest a new hook (or just write
ag.ml2007 at zirona.com
Sun Sep 9 16:30:40 GMT 2007
On Sun, 2007-09-09 at 12:59 +0200, Pixline wrote:
> I wrote a plugin  that needs a little template modification in
> order to work. But I have seen in the last two months that quite 9/10
> of potential users have troubles in doing this little modification .
> As long as I know, there's no hook available to make what this plugin
> is supposed to do (replace 'archive for category x' h2 with a page
> content, like a longer introduction to your category archives).
I'm very familiar with the problem that users are unable or unwilling to
do certain modifications to their templates. But if it is a template
issue, there's no way around it.
The problem in your case is that this text "archive for ..." does vary
very much across themes. Some themes will have similar phrase, others
are translated, some may even lack that section.
Yes, you could replace the section (as already proposed) by buffering
and regexing, but you will not be able to solve this automatically *and*
in a clean manner.
As for a hook, what sort of hook should that be? There are only very few
and generic hooks in the templates (like wp_head, wp_meta, wp_footer),
and with good reasons. A hook to print a single, template-related
section doesn't make sense.
I'm afraid you and your users will have to live with the necessity of
editing the template files.
Alex Günsche, Zirona OpenSource-Consulting
Blogs: http://www.zirona.com/ | http://www.regularimpressions.net
PubKey for this address: http://www.zirona.com/misc/ag.ml2007.asc
More information about the wp-hackers