WPSEO_Admin_Init::load_admin_page_class()privateYoast 1.0

Determine if we should load our admin pages class and if so, load it.

Loads admin page class for all admin pages starting with wpseo_.

Метод класса: WPSEO_Admin_Init{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->load_admin_page_class();

Код WPSEO_Admin_Init::load_admin_page_class() Yoast 24.0

private function load_admin_page_class() {

	if ( $this->on_wpseo_admin_page() ) {
		// For backwards compatabilty, this still needs a global, for now...
		$GLOBALS['wpseo_admin_pages'] = new WPSEO_Admin_Pages();

		$page = null;

		// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
		if ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) ) {
			// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
			$page = sanitize_text_field( wp_unslash( $_GET['page'] ) );
		}

		// Only renders Yoast SEO Premium upsells when the page is a Yoast SEO page.
		if ( $page !== null && WPSEO_Utils::is_yoast_seo_free_page( $page ) ) {
			$this->register_premium_upsell_admin_block();
		}
	}
}