WordPress\AiClient\Files\ValueObjects

MimeType::isType │ public │ WP 0.1.0

Checks if this MIME type is a specific type.

This method returns true when the stored MIME type begins with the given prefix. For example, "audio" matches "audio/mpeg".

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

Хуков нет.

Возвращает

bool. True if this MIME type is of the specified type.

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

$MimeType = new MimeType();
$MimeType->isType( $mimeType ): bool;
$mimeType(строка) (обязательный)
The MIME type prefix to check (e.g., "audio", "image").

Список изменений

С версии 0.1.0 Введена.

Код MimeType::isType() WP 7.1.2

public function isType(string $mimeType): bool
{
    return str_starts_with($this->value, strtolower($mimeType) . '/');
}