PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/integrations/admin/fix-news-dependencies-integration.php +18 -2 27.6 → trunk View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2
3 3 namespace Yoast\WP\SEO\Integrations\Admin;
4 4
5 -use WP_Screen;
6 5 use WPSEO_Admin_Asset_Manager;
7 6 use Yoast\WP\SEO\Conditionals\Admin_Conditional;
8 7 use Yoast\WP\SEO\Conditionals\News_Conditional;
8 +use Yoast\WP\SEO\Helpers\Current_Page_Helper;
9 9 use Yoast\WP\SEO\Integrations\Integration_Interface;
10 10
11 11 /**
12 12 * Fix_News_Dependencies_Integration class.
@@ -13,8 +13,24 @@
13 13 */
14 14 class Fix_News_Dependencies_Integration implements Integration_Interface {
15 15
16 16 /**
17 + * Holds the current page helper.
18 + *
19 + * @var Current_Page_Helper
20 + */
21 + private $current_page_helper;
22 +
23 + /**
24 + * Constructs the integration.
25 + *
26 + * @param Current_Page_Helper $current_page_helper The current page helper.
27 + */
28 + public function __construct( Current_Page_Helper $current_page_helper ) {
29 + $this->current_page_helper = $current_page_helper;
30 + }
31 +
32 + /**
17 33 * Returns the conditionals based in which this loadable should be active.
18 34 *
19 35 * In this case: when on an admin page.
20 36 *
@@ -50,9 +66,9 @@
50 66 if ( ! isset( $scripts->registered['wpseo-news-editor'] ) ) {
51 67 return;
52 68 }
53 69
54 - $is_block_editor = WP_Screen::get()->is_block_editor();
70 + $is_block_editor = $this->current_page_helper->is_block_editor();
55 71 $post_edit_handle = 'post-edit';
56 72 if ( ! $is_block_editor ) {
57 73 $post_edit_handle = 'post-edit-classic';
58 74 }