PluginProbe
Polylang / 2.6.3
Polylang v2.6.3
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | install/install-base.php +2 -24 2.82.6.3 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * A generic activation / de-activation class compatble with multisite
8 5 *
@@ -24,15 +21,10 @@
24 21 // Manages plugin activation and deactivation
25 22 register_activation_hook( $plugin_basename, array( $this, 'activate' ) );
26 23 register_deactivation_hook( $plugin_basename, array( $this, 'deactivate' ) );
27 24
28 - // Blog creation on multisite.
29 - if ( version_compare( $GLOBALS['wp_version'], '5.1', '<' ) ) {
30 - // FIXME: Backward compatibility with WP < 5.1.
31 - add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog' ), 5 ); // Before WP attempts to send mails which can break on some PHP versions
32 - } else {
33 - add_action( 'wp_insert_site', array( $this, 'new_site' ) );
34 - }
25 + // Blog creation on multisite
26 + add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog' ), 5 ); // Before WP attempts to send mails which can break on some PHP versions
35 27 }
36 28
37 29 /**
38 30 * Allows to detect plugin deactivation
@@ -111,23 +103,9 @@
111 103 // Can be overriden in child class
112 104 }
113 105
114 106 /**
115 - * Site creation on multisite ( to set default options )
116 - *
117 - * @since 2.6.8
118 - *
119 - * @param WP_Site $new_site New site object.
120 - */
121 - public function new_site( $new_site ) {
122 - switch_to_blog( $new_site->id );
123 - $this->_activate();
124 - restore_current_blog();
125 - }
126 -
127 - /**
128 107 * Blog creation on multisite ( to set default options )
129 - * Backward compatibility with WP < 5.1
130 108 *
131 109 * @since 0.9.4
132 110 *
133 111 * @param int $blog_id