• I’m using Options Framework on a WP Multisite network. When I create a new blog, I’d like to have the user’s settings prepopulated with the default values I’ve set up in options.php. Currently, I have to go in and press the Restore Defaults button to get the defaults to apply.

    Is there a function I can call when the blog is created that will emulate clicking in the Restore Defaults button and save the default values for the current blog?

    Thanks!
    Kevin

    http://wordpress.org/extend/plugins/options-framework/

Viewing 1 replies (of 1 total)
  • Thread Starter asocalguy

    (@asocalguy)

    If anyone is curious, this is how I accomplished what I was after:

    // get the array of default option values
    $values = of_get_default_values();
    
    // set the value of one of them
    $values['myfield'] = $myvalue;
    
    // save the option values
    update_option( 'optionsframework', $values );
    
    // force options framework to save its required settings
    // otherwise you have to browse the admin area first to get
    // the settings to "take"
    optionsframework_init();
Viewing 1 replies (of 1 total)
  • The topic ‘Default options and WP Multisite’ is closed to new replies.