[wp-hackers] Setting default options for plugin

Stephen Rider wp-hackers at striderweb.com
Fri Aug 31 21:01:03 GMT 2007

Is there an official or "best" method for setting default options for  
a plugin when it is first activated?  Currently I use something like  

if (!get_option('my_plugin')){
     // set default options
     add_option ( 'my_plugin_options',array( 'work_properly' =>  
true ) );

This is just "raw" inside the php file (not in a function) so it runs  
every time the PHP file is called.  Is there a better way of doing  
this or am I doing things right?


More information about the wp-hackers mailing list