WPSEO_Admin_Pages::config_page_scripts()
Loads the required scripts for the config page.
Метод класса: WPSEO_Admin_Pages{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WPSEO_Admin_Pages = new WPSEO_Admin_Pages(); $WPSEO_Admin_Pages->config_page_scripts();
Код WPSEO_Admin_Pages::config_page_scripts() WPSEO Admin Pages::config page scripts Yoast 23.4
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( 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() ), 'dismissedAlerts' => $dismissed_alerts, 'isRtl' => is_rtl(), 'isPremium' => YoastSEO()->helpers->product->is_premium(), 'isWooCommerceActive' => $woocommerce_conditional->is_met(), '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 ), ]; // 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, [ WPSEO_Admin::PAGE_IDENTIFIER, 'wpseo_workouts' ], true ) ) { wp_enqueue_media(); $script_data['media'] = [ 'choose_image' => __( 'Use Image', 'wordpress-seo' ), ]; $script_data['userEditUrl'] = add_query_arg( 'user_id', '{user_id}', admin_url( 'user-edit.php' ) ); } if ( $page === 'wpseo_tools' ) { $this->enqueue_tools_scripts(); } $this->asset_manager->localize_script( 'settings', 'wpseoScriptData', $script_data ); $this->asset_manager->enqueue_user_language_script(); }