| @@ -3,9 +3,8 @@ | ||
| 3 | 3 | namespace Yoast\WP\SEO\Integrations\Third_Party; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Plugin; |
| 6 | 6 | use WP_Post; |
| 7 | -use WP_Screen; | |
| 8 | 7 | use WPSEO_Admin_Asset_Manager; |
| 9 | 8 | use WPSEO_Admin_Recommended_Replace_Vars; |
| 10 | 9 | use WPSEO_Meta; |
| 11 | 10 | use WPSEO_Metabox_Analysis_Inclusive_Language; |
| @@ -18,8 +17,9 @@ | ||
| 18 | 17 | use Yoast\WP\SEO\Conditionals\Third_Party\Elementor_Edit_Conditional; |
| 19 | 18 | use Yoast\WP\SEO\Editors\Application\Site\Website_Information_Repository; |
| 20 | 19 | use Yoast\WP\SEO\Elementor\Infrastructure\Request_Post; |
| 21 | 20 | use Yoast\WP\SEO\Helpers\Capability_Helper; |
| 21 | +use Yoast\WP\SEO\Helpers\Current_Page_Helper; | |
| 22 | 22 | use Yoast\WP\SEO\Helpers\Options_Helper; |
| 23 | 23 | use Yoast\WP\SEO\Integrations\Integration_Interface; |
| 24 | 24 | use Yoast\WP\SEO\Presenters\Admin\Meta_Fields_Presenter; |
| 25 | 25 | use Yoast\WP\SEO\Promotions\Application\Promotion_Manager; |
| @@ -64,8 +64,15 @@ | ||
| 64 | 64 | */ |
| 65 | 65 | private $request_post; |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | + * Holds the current page helper. | |
| 69 | + * | |
| 70 | + * @var Current_Page_Helper | |
| 71 | + */ | |
| 72 | + private $current_page_helper; | |
| 73 | + | |
| 74 | + /** | |
| 68 | 75 | * Holds whether the socials are enabled. |
| 69 | 76 | * |
| 70 | 77 | * @var bool |
| 71 | 78 | */ |
| @@ -117,23 +124,26 @@ | ||
| 117 | 124 | |
| 118 | 125 | /** |
| 119 | 126 | * Constructor. |
| 120 | 127 | * |
| 121 | - * @param WPSEO_Admin_Asset_Manager $asset_manager The asset manager. | |
| 122 | - * @param Options_Helper $options The options helper. | |
| 123 | - * @param Capability_Helper $capability The capability helper. | |
| 124 | - * @param Request_Post $request_post The Request_Post. | |
| 128 | + * @param WPSEO_Admin_Asset_Manager $asset_manager The asset manager. | |
| 129 | + * @param Options_Helper $options The options helper. | |
| 130 | + * @param Capability_Helper $capability The capability helper. | |
| 131 | + * @param Request_Post $request_post The Request_Post. | |
| 132 | + * @param Current_Page_Helper $current_page_helper The current page helper. | |
| 125 | 133 | */ |
| 126 | 134 | public function __construct( |
| 127 | 135 | WPSEO_Admin_Asset_Manager $asset_manager, |
| 128 | 136 | Options_Helper $options, |
| 129 | 137 | Capability_Helper $capability, |
| 130 | - Request_Post $request_post | |
| 138 | + Request_Post $request_post, | |
| 139 | + Current_Page_Helper $current_page_helper | |
| 131 | 140 | ) { |
| 132 | - $this->asset_manager = $asset_manager; | |
| 133 | - $this->options = $options; | |
| 134 | - $this->capability = $capability; | |
| 135 | - $this->request_post = $request_post; | |
| 141 | + $this->asset_manager = $asset_manager; | |
| 142 | + $this->options = $options; | |
| 143 | + $this->capability = $capability; | |
| 144 | + $this->request_post = $request_post; | |
| 145 | + $this->current_page_helper = $current_page_helper; | |
| 136 | 146 | |
| 137 | 147 | $this->seo_analysis = new WPSEO_Metabox_Analysis_SEO(); |
| 138 | 148 | $this->readability_analysis = new WPSEO_Metabox_Analysis_Readability(); |
| 139 | 149 | $this->inclusive_language_analysis = new WPSEO_Metabox_Analysis_Inclusive_Language(); |
| @@ -462,9 +472,9 @@ | ||
| 462 | 472 | |
| 463 | 473 | $script_data = [ |
| 464 | 474 | 'metabox' => $this->get_metabox_script_data( $permalink ), |
| 465 | 475 | 'isPost' => true, |
| 466 | - 'isBlockEditor' => WP_Screen::get()->is_block_editor(), | |
| 476 | + 'isBlockEditor' => $this->current_page_helper->is_block_editor(), | |
| 467 | 477 | 'isElementorEditor' => true, |
| 468 | 478 | 'isAlwaysIntroductionV2' => $this->is_elementor_version_compatible_with_introduction_v2(), |
| 469 | 479 | 'isElementorV4Atomic' => $is_v4_atomic, |
| 470 | 480 | 'postStatus' => \get_post_status( $post_id ), |