[wp-hackers] Filtering the default in get_option()

Frank Bueltge frank at bueltge.de
Tue Apr 3 06:32:52 UTC 2012

You can also filter via bloginfo_url
see this example; maybe this help you

Best regards

On Tue, Apr 3, 2012 at 1:59 AM, Adam Backstrom <adam at sixohthree.com> wrote:
> get_option() supports two filters: pre_option_$option and option_$option.
> I'd like to filter the options for a plugin, which in this case is stored
> as a single serialized array. I was hoping to lock in certain option values
> and let the plugin UI handle the rest, but pre_option_$option overrides all
> options saved in the database, and option_$option won't run if the option
> record does not yet exist in the database. I could probably accomplish this
> modifying option filters on the fly (filter on pre_option_, disable filter
> and get_option again, modify the value from the database).
> As far as patches go, was there ever talk of running the option_$option
> filter on the $default value of the function?
> _______________________________________________
> 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