WordPress.org

Forums

Seriously Simple Podcasting
[resolved] Defining Default Settings For New Sites (6 posts)

  1. colinmcgray
    Member
    Posted 2 years ago #

    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/

  2. Hugh Lashbrooke
    Member
    Plugin Author

    Posted 2 years ago #

    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!

  3. colinmcgray
    Member
    Posted 2 years ago #

    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

  4. Hugh Lashbrooke
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  5. colinmcgray
    Member
    Posted 2 years ago #

    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

  6. Hugh Lashbrooke
    Member
    Plugin Author

    Posted 2 years ago #

    Great - happy to help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Seriously Simple Podcasting
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic