WPSEO_Admin_Init::on_wpseo_admin_page
Helper to verify if the user is currently visiting one of our admin pages.
Метод класса: WPSEO_Admin_Init{}
Хуков нет.
Возвращает
true|false.
Использование
// private - только в коде основоного (родительского) класса $result = $this->on_wpseo_admin_page();
Код WPSEO_Admin_Init::on_wpseo_admin_page() WPSEO Admin Init::on wpseo admin page Yoast 27.7
private function on_wpseo_admin_page() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
if ( ! isset( $_GET['page'] ) || ! is_string( $_GET['page'] ) ) {
return false;
}
if ( $this->pagenow !== 'admin.php' ) {
return false;
}
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
$current_page = sanitize_text_field( wp_unslash( $_GET['page'] ) );
return strpos( $current_page, 'wpseo' ) === 0;
}