This function retrieves the Field Type on the Contact Fields list for a given field.


wpf_get_field_type( $meta_key, $default = 'text' )
  • $meta_key (string) (Required): The meta key to retrieve the field type of.
  • $default (string) (Optional): The default value to return if no type is found.


(string) The field type.

#Get a fields Field Type.

$field_type = wpf_get_field_type( $meta_key );

#Get a fields Field Type, but pass a string if no Field Type is found

$field_type = wpf_get_field_type( $meta_key, $default = 'default' );

Was this helpful?