[wp-hackers] new filter hook in get_option()

Peter Westwood peter.westwood at ftwr.co.uk
Fri Oct 15 14:58:12 UTC 2010


Hi,

On 15 Oct 2010, at 15:27, Leo germani wrote:

> Ive submited a patch to create a new filter hook in get_option() function.
> 
> I think its very useful and completely harmless, so I would like to ask if
> you guys can have a look and share opinions here.
> 
> the description:
> Current filter 'pre_option_$option' does not pass the option name as a
> parameter, so you need to have one specific function for each option you
> want to filter. This does not allow you to filter dynamically created
> options, nor lets you filter all options if you want to do so.
> My patch creates a new filter called 'get_option' which passes the
> parameters 'option_name' and the 'default_value', so you can have one filter
> to filter many options.
> 

If you need context please use {{{current_filter()}}}.

Cheers
-- 
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5



More information about the wp-hackers mailing list