Sorry, I didn’t find valid place for this question so I ask it here.
How can I get default options and save them after activating theme ?
I do it in this way:
add_action( 'after_setup_theme', 'save_smof_options' );
function save_smof_options(){
if( !defined('ADMIN_PATH') )
define( 'ADMIN_PATH', get_template_directory() . '/admin/' );
if( !defined('ADMIN_DIR') )
define( 'ADMIN_DIR', get_template_directory_uri() . '/admin/' );
require_once( ADMIN_PATH . 'functions/functions.php' );
require_once( ADMIN_PATH . 'functions/functions.filters.php' );
require_once( ADMIN_PATH . 'functions/functions.interface.php' );
require_once( ADMIN_PATH . 'functions/functions.options.php' );
require_once( ADMIN_PATH . 'functions/functions.admin.php' );
global $of_options, $options_machine, $smof_data, $smof_details;
$options_machine = new Options_Machine($of_options);
of_save_options($options_machine->Defaults);
of_save_options(date('r'), 'smof_init');
$smof_data = of_get_options();
}
I found that $smof_data array doesn’t contains some indexes, that I write in functions.options.php. If I go to theme options page and press button SAVE OPTIONS – they will appear, but I want to somehow save them automaticly.