[wp-hackers] Settings pages
Simon Wheatley
simon at sweetinteraction.com
Fri Jun 12 07:56:58 GMT 2009
n Fri, Jun 12, 2009 at 4:03 AM, Ptah Dunbar<pt at ptahd.com> wrote:
>
> If i'm creating an option using the register_setting API, is there a
> mechanism for giving it an initial value or should I just keep using
> add_option();?
>
I'd be interested in how others do this, I run something similar to
the following on plugin activation:
// Get the option (returns a default if it doesn't exist)
$value = get_option( $name, $some_default_value );
// Then set the option value in case it didn't exist
update_option( $name, $value );
Hope this helps.
S
---
Sweet Interaction Ltd is Registered in England/Wales, no. 6610741
Registered office: 7 Malton Av, Manchester, M21 8AT
More information about the wp-hackers
mailing list