Skip to content

Method

Determine if the field has a given class.

has_class( string $class )

public

Parameters

$class string
The class.

Return

bool True if the field has the given class, false if not.

Source

public function has_class( $class ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.classFound -- public API parameter name, renaming risks breaking PHP 8 named-argument callers.
    return in_array( $class, $this->classes, true );
}

Uses

Changelog

VersionDescription
7.0.13 Introduced.