| @@ -127,8 +127,10 @@ | ||
| 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 | |
| 131 | 133 | */ |
| 132 | 134 | public static function define_constants() { |
| 133 | 135 | // Cookie name. no cookie will be used if set to false |
| 134 | 136 | if ( ! defined( 'PLL_COOKIE' ) ) { |
| @@ -155,8 +157,10 @@ | ||
| 155 | 157 | * Polylang initialization |
| 156 | 158 | * setups models and separate admin and frontend |
| 157 | 159 | * |
| 158 | 160 | * @since 1.2 |
| 161 | + * | |
| 162 | + * @return void | |
| 159 | 163 | */ |
| 160 | 164 | public function init() { |
| 161 | 165 | global $polylang; |
| 162 | 166 | |
| @@ -236,10 +240,13 @@ | ||
| 236 | 240 | |
| 237 | 241 | require_once __DIR__ . '/api.php'; // Loads the API |
| 238 | 242 | |
| 239 | 243 | // Loads the modules. |
| 240 | - foreach ( glob( POLYLANG_DIR . '/modules/*/load.php', GLOB_NOSORT ) as $load_script ) { | |
| 241 | - require_once $load_script; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable | |
| 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 | + } | |
| 242 | 249 | } |
| 243 | 250 | |
| 244 | 251 | $polylang->init(); |
| 245 | 252 | |