WPSEO_Yoast_Columns::get_current_post_type()privateYoast 1.0

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() Yoast 22.4

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 '';
}