| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Integrations\Admin; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Conditionals\Admin_Conditional; |
| 6 |
use Yoast\WP\SEO\Integrations\Integration_Interface; |
| 7 |
|
| 8 |
/** |
| 9 |
* Disable_Concatenate_Scripts_Integration class. |
| 10 |
*/ |
| 11 |
class Disable_Concatenate_Scripts_Integration implements Integration_Interface { |
| 12 |
|
| 13 |
/** |
| 14 |
* Returns the conditionals based in which this loadable should be active. |
| 15 |
* |
| 16 |
* In this case: when on an admin page. |
| 17 |
* |
| 18 |
* @return array The conditionals. |
| 19 |
*/ |
| 20 |
public static function get_conditionals() { |
| 21 |
return [ Admin_Conditional::class ]; |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Registers an action to disable script concatenation. |
| 26 |
*/ |
| 27 |
public function register_hooks() { |
| 28 |
\add_action( 'wp_print_scripts', [ $this, 'disable_concatenate_scripts' ] ); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Due to bugs in the 5.5 core release concatenate scripts is causing errors. |
| 33 |
* |
| 34 |
* Because of this we disable it. |
| 35 |
* |
| 36 |
* @return void |
| 37 |
*/ |
| 38 |
public function disable_concatenate_scripts() { |
| 39 |
global $concatenate_scripts; |
| 40 |
|
| 41 |
$concatenate_scripts = false; |
| 42 |
} |
| 43 |
} |
| 44 |
|