Easy plugin options

<?php
$plugin_options = array(
'option1' => 'value1',
'option2' => 'value2',
'option2' => 'value3',
'option4' => 'value4'
);

//Set defaults and variables
foreach($plugin_options as $key => $value){
if(!get_option($key)){ update_option($key,$value); }
${$key} = get_option($key);
}
?>

0 Comments

You must be logged in to post a comment.