[wp-hackers] Edit Template Tags with Plugin

Nathan Rice ncrice at gmail.com
Fri Apr 17 13:16:34 GMT 2009


With some themes, this is possible. But they have to be build specifically
for this type of thing.  Most call them "theme frameworks".

My Website
http://www.nathanrice.net/

My Twitter
http://twitter.com/nathanrice


On Fri, Apr 17, 2009 at 9:06 AM, SoJ Web <sojweb at indiana.edu> wrote:

> I think this would be really tricky. Any solution would have to involved
> output buffering because those template files virtually always include
> script (unless you wanted to filter script). The functions you mentioned all
> have a do_action hook, so it might be possible to hook into that, turn on
> output buffering, load the files, process the buffer, and then output it.
> After the hook, WordPress will still try to load the files, but it uses a
> require_once, so that probably won't do anything.
>
> Out of curiosity, what would this be used for?
>
>
> -Jeff
>
>
> On Apr 17, 2009, at 2:09 AM, Aaron Jorbin wrote:
>
>  Hi
>>
>> I was at the Portland Wordpress User Group meeting tonight and brought
>> up a question and Lorelle said that this might be the best place for
>> it.  Any assistance that can be provided would of course be greatly
>> appreciated.
>>
>> What I am hoping to do is create a plugin that can filter the content
>> of theme files similiarly to
>>
>> add_filter('the_content','a_filter');
>>
>> The goal is to essentially allow for the plugin to modify the results
>> of the get_header(), get_footer() and get_sidebar() template tags, but
>> I haven't figured out how to do that.  I've tried
>>
>> remove_action('get_header', 'load_template');
>>
>> and replacing it with a function that would do what I would like, but
>> that doesn't work.  Does anyone have any advice on if this is
>> possible?  Anyone know if there are any plugins currently doing this?
>>
>> Thanks in advance for any tips that anyone is able to provide.
>> Aaron Jorbin
>> aaron.jorbin at gmail.com
>> Twitter: @aaronjorbin
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list