Nice Question!
But I’ll leave for the asker and for the reader the task of finding the plugin options name.
This can be used for any plugin/theme that relies in a single/serialized value in the wp_options
table. If it’s not a single value, it’s another task…
In this example, I’m using WP-Pagenavi option_name
.
Action hook found inside the function wpmu_create_blog
in the file /wp-includes/ms-functions.php
.
add_action( 'wpmu_new_blog', 'wpse_70977_copy_main_site_options', 10, 6 );
function wpse_70977_copy_main_site_options( $blog_id, $user_id, $domain, $path, $site_id, $meta )
{
$mainsite = get_option( 'pagenavi_options' );
switch_to_blog( $blog_id );
update_option( 'pagenavi_options', $mainsite );
restore_current_blog();
}
This code is tested with the plugin being activated on a per site basis, and with the plugin being Network Activated.
Related Posts:
- ‘Global’ settings page for multisite plugin
- How to add field for new site-wide option on Network Settings screen?
- How to tell if plugin has been network activated
- Duplicate settings of master blog to slave blogs in WP multi-site installation
- Network-Wide Plugin Settings Management
- Redirect to another page using contact form 7? [closed]
- Multisite Plugin – Access options (wp_options) on child sites
- How to get values from network settings panel?
- How to do I get a list of active plugins on my wordpress blog programmatically?
- How to tell if a plugin is multisite compatible?
- Correct way to serialize the data of options table?
- How to get the main blog’s id and db prefix from a mu plugin?
- Where should I use get_option in a plugin
- What is a Network Activated Plugin Exactly?
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- While using WordPress Multisite is it possible to display data to main site from subsites?
- Is it possible to run plugin code when a multisite blog is deleted?
- Multi domain, multi sites with different themes and content
- Getting Custom Post Type content from main-site of a Multisite
- How do I add a widget programmatically to a newly created site (WPMU) within a plugin?
- Environment Specific Options Token
- How do I extract the Alt Text from an image attachment upload via the WordPress Options Framework Plugin?
- How can I list only sites that use a particular theme or plugin?
- Posts wont expire
- Changing widget options via the functions.php when there are no hooks
- Unique post-id for WordPress Multisite Network
- Duplicate a Multi-Site Subdomain
- How to get last_updated and newest_blogs in WP 3.0
- Display All Non-Used Plugins
- clean wp_options table unused rows
- Prepare plugin options for multi-lingual support
- Having separate plugins and themes folder for multi-site setup
- Creating Custom Roles for use on a WordPress Multi-site Instance?
- Creating a plugin that will add options. Where should the options menu pages go?
- What Plugin Do You Use to Turn WordPress based site to A Blog Aggregator
- Add get_option to jquery
- Exclude plugins on Main site on Multisite installation?
- update_user_meta add value on the top on existing value
- Network: retrieve a list of latest posts
- How to add class in plugin only for network site?
- How to write a plugin to add users to a mail list
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- WordPress Multisite user activation hook from email
- Best method to upgrade multisite plugin’s numerous database table
- WordPress on AWS with ELB
- Create mobile navigation header with settings integration
- Media is not attached after import
- Admin Theme customization
- changes to widget settings not showing up in individual pages pages until they’re updated [closed]
- Show admin notice on incorrect value on form field
- Setup page on first login on multisite
- wp_editor content in plugin options page
- Will these plugins work with wp multisite?
- Add custom text color WordPress 3.9 TinyMCE 4 Visual editor
- Network activating; if ( !current_user_can( ‘manage_options’ ) ) locks me out…
- Update a core option from plugin settings page
- Multisite – maximum number of users with specific role
- WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog
- update_option_{$option} not showing old value
- Can deactivating a plugin sometimes “reset” settings within that plugin?
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Default plugin config to override wp_options?
- Update WP option by plugin
- Redirect Plugins.php to New Plugin Page
- How (or where) do I get wordpress plugin update download link?
- Adding option values as an array using a multi selectable select box
- Issue removing Media Editor Tabs — Duplicate Items
- Creating teams of users in WordPress
- Do WordPress plugins suport multisite site?
- Need to add/remove group of options and display them as rows
- Share plugins, themes, and multi post in a multidomain network
- Using call_user_func() within add_settings_section() within a Class
- Activation flow of a plugin in a multisite environment
- Hide fields in woocommerce settings
- Creating an array from form inputs before it is posted to the options database
- How to implement data residency in my WordPress site
- the content of the uploads folder gets deleted periodically, how to figure out what causes it?
- save short-code in my custom plugin settings problem missed something
- Plugin Options Page and Subpage
- save multi-select input using update_option for plugin
- Why my multisite is this slow? (stats inside)
- Admin Custom Login loses settings on Code and Data migration
- How to set plugin across network in multisite and modify it in one place?
- Protect WordPress option value
- Any way to force a specific plugin to use single site tables in multisite installation?
- How to create a new database table whenever user changes options
- get_option return incorrect values
- How know the “admin” blog from wordpress multisite?
- Create Array from data in the OPTIONS table
- Error when renaming option
- Plugin menu replaced by another plugin?
- WordPress internationalization + domains
- Internationalization of Blog Posts
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- Plugin De/Activation Not Firing On MultiSite install
- How to programmatically detect how many posts are displayed per page?
- I want to create a Visual Recipe site on WordPress, any suggestions or tips on how i can do it? [closed]
- Turning Existing Eccommerce Site into Multi-SIte
- selecting options from another form
- How to access values from your own settings page in javascript?