ACF_Internal_Post_Type::is_post_key │ public │ ACF 6.1

Returns true if the given identifier is an ACF post key.

Method of the class: ACF_Internal_Post_Type{}

Hooks from the method

Returns

boolean.

Usage

$ACF_Internal_Post_Type = new ACF_Internal_Post_Type();
$ACF_Internal_Post_Type->is_post_key( $id );
$id(string)
The identifier.
Default: ''

Changelog

Since 6.1 Introduced.

ACF_Internal_Post_Type::is_post_key() code ACF 6.8.8

public function is_post_key( $id = '' ) {
	// Check if $id is a string starting with $this->post_key.
	if ( is_string( $id ) && substr( $id, 0, strlen( $this->post_key_prefix ) ) === $this->post_key_prefix ) {
		return true;
	}

	/**
	 * Filters whether the $id is an ACF post key.
	 *
	 * @date    23/1/19
	 * @since   5.7.10
	 *
	 * @param bool $bool The result.
	 * @param string $id The identifier.
	 */
	return apply_filters( "acf/is_{$this->hook_name}_key", false, $id, $this->post_type );
}