| @@ -127,10 +127,8 @@ | ||
| 127 | 127 | * Defines constants |
| 128 | 128 | * May be overridden by a plugin if set before plugins_loaded, 1 |
| 129 | 129 | * |
| 130 | 130 | * @since 1.6 |
| 131 | - * | |
| 132 | - * @return void | |
| 133 | 131 | */ |
| 134 | 132 | public static function define_constants() { |
| 135 | 133 | // Cookie name. no cookie will be used if set to false |
| 136 | 134 | if ( ! defined( 'PLL_COOKIE' ) ) { |
| @@ -157,10 +155,8 @@ | ||
| 157 | 155 | * Polylang initialization |
| 158 | 156 | * setups models and separate admin and frontend |
| 159 | 157 | * |
| 160 | 158 | * @since 1.2 |
| 161 | - * | |
| 162 | - * @return void | |
| 163 | 159 | */ |
| 164 | 160 | public function init() { |
| 165 | 161 | global $polylang; |
| 166 | 162 | |
| @@ -212,9 +208,9 @@ | ||
| 212 | 208 | } elseif ( PLL_ADMIN ) { |
| 213 | 209 | $class = 'PLL_Admin'; |
| 214 | 210 | } elseif ( self::is_rest_request() ) { |
| 215 | 211 | $class = 'PLL_REST_Request'; |
| 216 | - } elseif ( $model->get_languages_list() ) { | |
| 212 | + } elseif ( $model->get_languages_list() && empty( $_GET['deactivate-polylang'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 217 | 213 | $class = 'PLL_Frontend'; |
| 218 | 214 | } |
| 219 | 215 | |
| 220 | 216 | /** |
| @@ -240,13 +236,10 @@ | ||
| 240 | 236 | |
| 241 | 237 | require_once __DIR__ . '/api.php'; // Loads the API |
| 242 | 238 | |
| 243 | 239 | // Loads the modules. |
| 244 | - $load_scripts = glob( POLYLANG_DIR . '/modules/*/load.php', GLOB_NOSORT ); | |
| 245 | - if ( is_array( $load_scripts ) ) { | |
| 246 | - foreach ( $load_scripts as $load_script ) { | |
| 247 | - require_once $load_script; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable | |
| 248 | - } | |
| 240 | + foreach ( glob( POLYLANG_DIR . '/modules/*/load.php', GLOB_NOSORT ) as $load_script ) { // phpcs:ignore WordPressVIPMinimum.Variables.VariableAnalysis.UnusedVariable | |
| 241 | + require_once $load_script; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable | |
| 249 | 242 | } |
| 250 | 243 | |
| 251 | 244 | $polylang->init(); |
| 252 | 245 | |