Skip to content

Function

Determine if an extension exists.

tml_extension_exists( string $extension )

Parameters

$extension string
The extension name.

Return

bool True if the extension exists or false otherwise.

Source

function tml_extension_exists( $extension ) {
    $exists = array_key_exists( $extension, tml_get_extensions() );

    /**
     * Filter whether an extension exists or not.
     *
     * @since 7.0
     *
     * @param bool   $exists    Whether the extension exists or not.
     * @param string $extension The extension name.
     */
    return apply_filters( 'tml_extension_exists', $exists, $extension );
}

Uses

Used by

Changelog

VersionDescription
7.0 Introduced.