[wp-hackers] Edit Template Tags with Plugin
scribu
scribu at gmail.com
Sat Apr 18 06:27:26 GMT 2009
On Sat, Apr 18, 2009 at 1:21 AM, Aaron Jorbin <aaron.jorbin at gmail.com>wrote:
> The Goal is to create an easily (from the user standpoint)
> controllable and customizable nofollow / dofollow plugin that will
> allow for fine grained control of individual links on a page by page
> and post by post basis.
>
I think what you really need is conditional
tags<http://codex.wordpress.org/Conditional_Tags>.
This is how you would make it work:
add_action('template_redirect', 'my_nofollow_plugin');
function my_nofollow_plugin() {
if ( is_page(124) ) {
// add nofollow script etc. you can use wp_enqueue_script
}
}
First, it hooks into the template_redirect action and then it does the
processing only if it is on the required page. You can combine as many
conditional tags as you want.
Although, if you want it to work on a link by link basis, you will have to
use output buffering. Just don't know how you would be able to build an UI
for this.
--
http://scribu.net
More information about the wp-hackers
mailing list