Hi
I have created custom fields and wanted to make it so a custom attribute key and value can show/hide the field input and the field label. So it behaves like the metabox hidden field but with a option to show/hide this. What is the best approach for this? as if I use the custom attribute to hide the input field then the field label is still visible obviously.
here is my custom field code...
public static function html( $meta, $field ) {
$required = $field['required'] ?? 0; //metabox field option
return sprintf(
$html = '
<input id="' . $uniqueID . '" required="' . $required . '" type="text" title="' . $field['field_name'] . '" value="' . $meta . '" name="%s">
',
$field['field_name'],
//$field['id'],
$meta
);
}
thanks
Nick