Options Framework
Default options and WP Multisite (2 posts)

  1. asocalguy
    Posted 2 years ago #

    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?



  2. asocalguy
    Posted 2 years ago #

    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"

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Options Framework
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic