WPSEO_Utils::get_page_type()public staticYoast 1.0

Gets the type of the current page.

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

Хуков нет.

Возвращает

Строку. Returns 'post' if the current page is a post edit page. Taxonomy in other cases.

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

$result = WPSEO_Utils::get_page_type();

Код WPSEO_Utils::get_page_type() Yoast 22.4

public static function get_page_type() {
	global $pagenow;
	if ( WPSEO_Metabox::is_post_edit( $pagenow ) ) {
		return 'post';
	}

	return 'taxonomy';
}