Last updated 2 years ago
Was this helpful?
This field type renders a URL field.
Parameters are inherited from the field type, but only URLs are allowed.
The code below renders a URL field with the custom_field name, "Custom field" label and "Custom text" placeholder. This field requires a non-empty value.
custom_field
echo ( new HivePress\Fields\URL( [ 'name' => 'custom_field', 'label' => 'Custom field', 'placeholder' => 'Custom text', 'required' => true, ] ) )->render();