| @@ -21,15 +21,10 @@ | ||
| 21 | 21 | // Manages plugin activation and deactivation |
| 22 | 22 | register_activation_hook( $plugin_basename, array( $this, 'activate' ) ); |
| 23 | 23 | register_deactivation_hook( $plugin_basename, array( $this, 'deactivate' ) ); |
| 24 | 24 | |
| 25 | - // Blog creation on multisite. | |
| 26 | - if ( version_compare( $GLOBALS['wp_version'], '5.1', '<' ) ) { | |
| 27 | - // FIXME: Backward compatibility with WP < 5.1. | |
| 28 | - add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog' ), 5 ); // Before WP attempts to send mails which can break on some PHP versions | |
| 29 | - } else { | |
| 30 | - add_action( 'wp_insert_site', array( $this, 'new_site' ) ); | |
| 31 | - } | |
| 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 | |
| 32 | 27 | } |
| 33 | 28 | |
| 34 | 29 | /** |
| 35 | 30 | * Allows to detect plugin deactivation |
| @@ -108,23 +103,9 @@ | ||
| 108 | 103 | // Can be overriden in child class |
| 109 | 104 | } |
| 110 | 105 | |
| 111 | 106 | /** |
| 112 | - * Site creation on multisite ( to set default options ) | |
| 113 | - * | |
| 114 | - * @since 2.6.8 | |
| 115 | - * | |
| 116 | - * @param WP_Site $new_site New site object. | |
| 117 | - */ | |
| 118 | - public function new_site( $new_site ) { | |
| 119 | - switch_to_blog( $new_site->id ); | |
| 120 | - $this->_activate(); | |
| 121 | - restore_current_blog(); | |
| 122 | - } | |
| 123 | - | |
| 124 | - /** | |
| 125 | 107 | * Blog creation on multisite ( to set default options ) |
| 126 | - * Backward compatibility with WP < 5.1 | |
| 127 | 108 | * |
| 128 | 109 | * @since 0.9.4 |
| 129 | 110 | * |
| 130 | 111 | * @param int $blog_id |