WPSEO_Yoast_Columns::get_current_post_type
Retrieves the post type from the $_GET variable.
Метод класса: WPSEO_Yoast_Columns{}
Хуков нет.
Возвращает
Строку. The current post type.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_current_post_type();
Код WPSEO_Yoast_Columns::get_current_post_type() WPSEO Yoast Columns::get current post type Yoast 26.5
private function get_current_post_type() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
if ( isset( $_GET['post_type'] ) && is_string( $_GET['post_type'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
return sanitize_text_field( wp_unslash( $_GET['post_type'] ) );
}
return '';
}