Uma área de pesquisa sobre o WordPress para devs e autores do tema



registered_meta_key_exists ›

Desde4.6.0
Obsoleton/a
registered_meta_key_exists ( $object_type, $meta_key, $object_subtype = '' )
Parâmetros: (3)
  • (string) $object_type The type of object.
    Required: Yes
  • (string) $meta_key The meta key.
    Required: Yes
  • (string) $object_subtype Optional. The subtype of the object type.
    Required: No
    Padrão: (empty)
Retorna:
  • (bool) True if the meta key is registered to the object type and, if provided, the object subtype. False if not.
Definido em:
Codex:
Log de mudanças:
  • 4.9.8

Checks if a meta key is registered.



Fonte

function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = '' ) {
	$meta_keys = get_registered_meta_keys( $object_type, $object_subtype );

	return isset( $meta_keys[ $meta_key ] );
}