WPSEO_Utils::is_metabox_active()public staticYoast 1.0

Determines whether the metabox is active for the given identifier and type.

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

Хуков нет.

Возвращает

true|false. Whether or not the metabox is active.

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

$result = WPSEO_Utils::is_metabox_active( $identifier, $type );
$identifier(строка) (обязательный)
The identifier to check for.
$type(строка) (обязательный)
The type to check for.

Код WPSEO_Utils::is_metabox_active() Yoast 22.4

public static function is_metabox_active( $identifier, $type ) {
	if ( $type === 'post_type' ) {
		return self::display_post_type_metabox( $identifier );
	}

	if ( $type === 'taxonomy' ) {
		return self::display_taxonomy_metabox( $identifier );
	}

	return false;
}