admin管理员组

文章数量:1390756

I am using multisite to translate WordPress website and I have the plugin / which I want to be accessible from all languages. From all site you should see the same uploaded content and settings. How can I achieve that? Currently if I upload in one language I won't be able to see in another.

I am using multisite to translate WordPress website and I have the plugin https://wordpress/plugins/nmedia-user-file-uploader/ which I want to be accessible from all languages. From all site you should see the same uploaded content and settings. How can I achieve that? Currently if I upload in one language I won't be able to see in another.

Share Improve this question edited Dec 20, 2018 at 6:15 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Jun 23, 2015 at 22:21 RobRob 411 silver badge2 bronze badges 2
  • Support for specific plugin or theme is off-topic here. – Nilambar Sharma Commented Jun 24, 2015 at 3:16
  • 4 @Nilambar - Since the question of how to get settings to propagate across blogs is plugin-agnostic, I think it is on-topic. Besides, where else could Rob ask such a question? – JJ Rohrer Commented Jun 24, 2015 at 12:57
Add a comment  | 

2 Answers 2

Reset to default 4

The generic way to do it, is by using the pre_option_{option} https://codex.wordpress/Plugin_API/Filter_Reference/pre_option_(option_name) filter to override the "local" settings and use the value being stored in your "main" sub site.

something like

add_filter( 'pre_option_the_plugin_option_name', function () {
  // Code assumes that "blog" 1 is the main one in which the relevant settings are stored.
  if (get_current_blog_id() != 1) {
    return get_blog_option(1, 'the_plugin_option_name');
  }

  return false;
}

Depending on the complexity of the plugin, it might not be enough and you will need additional overrides, but this type of code should be enough for simple cases.

I almost thought this was a duplicate to Network-Wide Plugin Settings Management , but I see you also want shared content.

Basically, this is tough and situation and plugin dependent. I'm a fan of WPMUDev's premium New Blog Template for copying content and settings upon blog creation, but it doesn't help with subsequent settings and content changes.

WPMUDev also has MultiSite Content Copier which might work for you. I haven't tried it myself, but it looks reasonable. There may very well be other, and cheaper, options, too.

I hope this helps - good luck.

本文标签: multisiteHow do I share plugin settings across WordPress network