URL

This field type renders a URL field.

Parameters

Parameters are inherited from the Text field type, but only URLs are allowed.

Example

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.

echo ( new HivePress\Fields\URL(
	[
		'name'        => 'custom_field',
		'label'       => 'Custom field',
		'placeholder' => 'Custom text',
		'required'    => true,
	]
) )->render();

Last updated