• Resolved colinmcgray

    (@colinmcgray)


    Hi Hugh,

    Quick question and hopefully not too difficult for you.

    I’m running a multisite wordpress setup with Seriously Simple Podcasting on it. I’d like to set the default Podcasting settings to be slightly different when someone starts a new site.

    Specifically, I’d like it so that every new site has the “Include podcast episodes in home page blog listing:” box ticked by default.

    Can you tell me where to find the default settings in the Plugin files? I’m guessing I just need to change one bit of code in the initial setup part of the plugin so that it’s set to ticked instead of not.

    Your help would be much appreciated as always!
    Colin

    http://wordpress.org/extend/plugins/seriously-simple-podcasting/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Hugh Lashbrooke

    (@hlashbrooke)

    Hi Colin,

    You shouldn’t edit anything like that in the plugin, but you can easily set that option to be ticked by default using this code:

    $option = get_option( 'ss_podcasting_include_in_main_query' );
    if( ! $option ) { update_option( 'ss_podcasting_include_in_main_query', 'on' ); }

    Just add that to the theme’s functions.php file and then, when the site loads, it will check to see if that option is set and if it is not then it will be switched on. This will only happen once and after that it will no longer have an effect.

    You can read through the classes/class-seriously-simple-podcasting-admin.php file to see what the other options are called.

    Hope that helps!

    Thread Starter colinmcgray

    (@colinmcgray)

    That’s brilliant, thanks Hugh! Works perfectly when using the same theme each time.

    I wonder, is there a place to put this that isn’t the theme functions file? I have used a ‘random theme’ plugin for new accounts in the past, so putting that snippet in the theme functions file might not be practical.

    Is there another functions file that is run each time a new site is set up?

    Thanks again for all your help,
    Colin

    Plugin Contributor Hugh Lashbrooke

    (@hlashbrooke)

    In that case, I would recommend that you put this code in a plugin – you can then use that plugin for setting up any other default features for the sites. You can create this plugin as a must use plugin to ensure that users cannot disable it.

    Thread Starter colinmcgray

    (@colinmcgray)

    Excellent, great idea Hugh.

    I hadn’t realised I could define settings for all plugins within one custom plugin, but now you describe it, it makes sense.

    Thanks again for your help,
    Colin

    Plugin Contributor Hugh Lashbrooke

    (@hlashbrooke)

    Great – happy to help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Defining Default Settings For New Sites’ is closed to new replies.