acf_is_field_key()ACF 5.0.0

acf_is_field_key

Returns true if the given identifier is a field key.

Hooks from the function

Returns

true|false.

Usage

acf_is_field_key( $id );
$id(string)
The identifier.
Default: ''

Changelog

Since 5.0.0 Introduced.

acf_is_field_key() code ACF 6.0.4

function acf_is_field_key( $id = '' ) {

	// Check if $id is a string starting with "field_".
	if ( is_string( $id ) && substr( $id, 0, 6 ) === 'field_' ) {
		return true;
	}

	/**
	 * Filters whether the $id is a field key.
	 *
	 * @date    23/1/19
	 * @since   5.7.10
	 *
	 * @param   bool $bool The result.
	 * @param   string $id The identifier.
	 */
	return apply_filters( 'acf/is_field_key', false, $id );
}