Merged in feature/314-dev-dev01 (pull request #24)
auto-patch 314-dev-dev01-2024-01-25T04_09_02 * auto-patch 314-dev-dev01-2024-01-25T04_09_02
This commit is contained in:
@@ -5,10 +5,12 @@
|
||||
* @package WPSEO\Admin
|
||||
*/
|
||||
|
||||
use Yoast\WP\SEO\Actions\Alert_Dismissal_Action;
|
||||
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
|
||||
use Yoast\WP\SEO\Integrations\Academy_Integration;
|
||||
use Yoast\WP\SEO\Integrations\Settings_Integration;
|
||||
use Yoast\WP\SEO\Integrations\Support_Integration;
|
||||
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
|
||||
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
|
||||
|
||||
/**
|
||||
* Class WPSEO_Admin_Pages.
|
||||
@@ -42,11 +44,13 @@ class WPSEO_Admin_Pages {
|
||||
|
||||
/**
|
||||
* Make sure the needed scripts are loaded for admin pages.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init() {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
|
||||
$page = isset( $_GET['page'] ) && is_string( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
|
||||
if ( \in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE ], true ) ) {
|
||||
if ( in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE ], true ) ) {
|
||||
// Bail, this is managed in the applicable integration.
|
||||
return;
|
||||
}
|
||||
@@ -57,6 +61,8 @@ class WPSEO_Admin_Pages {
|
||||
|
||||
/**
|
||||
* Loads the required styles for the config page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function config_page_styles() {
|
||||
wp_enqueue_style( 'dashboard' );
|
||||
@@ -75,27 +81,29 @@ class WPSEO_Admin_Pages {
|
||||
|
||||
/**
|
||||
* Loads the required scripts for the config page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function config_page_scripts() {
|
||||
$this->asset_manager->enqueue_script( 'settings' );
|
||||
wp_enqueue_script( 'dashboard' );
|
||||
wp_enqueue_script( 'thickbox' );
|
||||
|
||||
$alert_dismissal_action = YoastSEO()->classes->get( \Yoast\WP\SEO\Actions\Alert_Dismissal_Action::class );
|
||||
$alert_dismissal_action = YoastSEO()->classes->get( Alert_Dismissal_Action::class );
|
||||
$dismissed_alerts = $alert_dismissal_action->all_dismissed();
|
||||
$woocommerce_conditional = new WooCommerce_Conditional();
|
||||
|
||||
$script_data = [
|
||||
'userLanguageCode' => WPSEO_Language_Utils::get_language( \get_user_locale() ),
|
||||
'userLanguageCode' => WPSEO_Language_Utils::get_language( get_user_locale() ),
|
||||
'dismissedAlerts' => $dismissed_alerts,
|
||||
'isRtl' => is_rtl(),
|
||||
'isPremium' => YoastSEO()->helpers->product->is_premium(),
|
||||
'isWooCommerceActive' => $woocommerce_conditional->is_met(),
|
||||
'currentPromotions' => YoastSEO()->classes->get( Yoast\WP\SEO\Promotions\Application\Promotion_Manager::class )->get_current_promotions(),
|
||||
'currentPromotions' => YoastSEO()->classes->get( Promotion_Manager::class )->get_current_promotions(),
|
||||
'webinarIntroSettingsUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/webinar-intro-settings' ),
|
||||
'webinarIntroFirstTimeConfigUrl' => $this->get_webinar_shortlink(),
|
||||
'linkParams' => WPSEO_Shortlinker::get_query_params(),
|
||||
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
|
||||
'pluginUrl' => plugins_url( '', WPSEO_FILE ),
|
||||
];
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
|
||||
@@ -145,6 +153,8 @@ class WPSEO_Admin_Pages {
|
||||
|
||||
/**
|
||||
* Enqueues and handles all the tool dependencies.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function enqueue_tools_scripts() {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
|
||||
|
||||
Reference in New Issue
Block a user