WordPress\AiClient\Files\ValueObjects

MimeType::isTypepublicWP 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".

Method of the class: MimeType{}

No Hooks.

Returns

true|false. True if this MIME type is of the specified type.

Usage

$MimeType = new MimeType();
$MimeType->isType( $mimeType ): bool;
$mimeType(string) (required)
The MIME type prefix to check (e.g., "audio", "image").

Changelog

Since 0.1.0 Introduced.

MimeType::isType() code WP 7.0

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