[wp-hackers] Replacing Hooks/Functions
Rob Miller
r at robm.me.uk
Mon Jul 3 20:41:07 GMT 2006
Computer Guru wrote:
> Instead of changing a filter, I want my plugin to replace a core WP function.
>
> I’m not “deep” into WP plugin writing, so bear with me if this is obvious:
>
>
>
> For example, I want to replace the_content() with my own function. If I add my function as a filter, it will take the data the_content returns and work on it.
>
> But I need to replace the_content itself…
>
>
>
> Any advice on how I would go about doing that without changing the core WP files (i.e. via a plugin)?
>
> Many thanks,
>
>
>
> Computer Guru
>
> NeoSmart Technologies <http://neosmart.net/>
>
> http://neosmart.net/blog/
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
What's the difference? Just set your filter to run last (give it a
priority of 10) and return whatever you would return if you could
override the function. That'll achieve exactly the same.
--
Rob Miller
http://robm.me.uk/ | http://kantian.co.uk/
More information about the wp-hackers
mailing list