WPSEO_Utils::display_post_type_metabox()protected staticYoast 1.0

Determine whether or not the metabox should be displayed for a post type.

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

Хуки из метода

Возвращает

true|false. Whether or not the metabox should be displayed.

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

$result = WPSEO_Utils::display_post_type_metabox( $post_type );
$post_type(строка|null)
The post type to check the visibility of the metabox for.
По умолчанию: null

Код WPSEO_Utils::display_post_type_metabox() Yoast 22.4

protected static function display_post_type_metabox( $post_type = null ) {
	if ( ! isset( $post_type ) ) {
		$post_type = get_post_type();
	}

	if ( ! isset( $post_type ) || ! WPSEO_Post_Type::is_post_type_accessible( $post_type ) ) {
		return false;
	}

	if ( $post_type === 'attachment' && WPSEO_Options::get( 'disable-attachment' ) ) {
		return false;
	}

	return apply_filters( 'wpseo_enable_editor_features_' . $post_type, WPSEO_Options::get( 'display-metabox-pt-' . $post_type ) );
}