WordPress.org

Ready to get started?Download WordPress

Forums

Viper's Video Quicktags
[resolved] Configuring default settings on multisite blog (3 posts)

  1. mrenoch
    Member
    Posted 3 years ago #

    Hi,

    I am running vvq in a multisite wordpress (3.0+) and I want to customize the default settings that are applied to new blogs upon creation.

    For other plugins I have wanted to customize (without changing their code directly) I have been able to add an action to the wpmu_new_blog event (add_action('wpmu_new_blog',... );), switch to the new blog (switch_to_blog($blog_id);), and update the option (update_option('vvq_options', ...);)

    This doesn't seem to be working for me with vvq. I think its because of the way vvq is initialized, but I am not sure.

    Can anyone recommend a technique for me to customize the default settings, that are applied to new blogs upon creation?

    Is there an event I can latch onto that will be fired after this plugin is initialized? Or, should I alter the global default settings singleton directly?

    Thanks!

  2. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    The default options are run through a filter called vvq_defaultsettings. Use it. :)

    add_filter( 'vvq_defaultsettings', 'mrenoch_vvq_defaults' );
    
    function mrenoch_vvq_defaults( $defaults ) {
    	$defaults['youtube']['autoplay'] = 1;
    
    	return $defaults;
    }
  3. mrenoch
    Member
    Posted 3 years ago #

    Works like a charm. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic