The package provides a variety of HTML5 fields that can be used to create modern and interactive field groups and blocks in WordPress. This document covers the HTML5 fields available in the package and how to use them.
The Email field is used to create email input fields. It accepts the input settings.
<?php
use Pollora\Metabox\Fields\Email;
Email::make('Email Address', 'email_address')
->size(30)
->prepend('user@')
->append('.com');size(int $size): Sets the size of the input field.prepend(string $text): Sets the text to prepend to the input field.append(string $text): Sets the text to append to the input field.
The Number field is used to create number input fields. It accepts the input settings, plus min(), max() and step().
<?php
use Pollora\Metabox\Fields\Number;
Number::make('Quantity', 'quantity')
->min(1)
->max(100)
->step(1);min(int $min): Sets the minimum value for the number field.max(int $max): Sets the maximum value for the number field.step(int $step): Sets the step value for the number field.
The Range field is used to create range input fields. It accepts the input settings, plus min(), max() and step().
<?php
use Pollora\Metabox\Fields\Range;
Range::make('Volume', 'volume')
->min(0)
->max(100)
->step(5);min(int $min): Sets the minimum value for the range field.max(int $max): Sets the maximum value for the range field.step(int $step): Sets the step value for the range field.
The Url field is used to create URL input fields. It accepts the input settings.
<?php
use Pollora\Metabox\Fields\Url;
Url::make('Website', 'website')
->size(50)
->prepend('https://')
->append('.com');size(int $size): Sets the size of the input field.prepend(string $text): Sets the text to prepend to the input field.append(string $text): Sets the text to append to the input field.
Previous: Advanced fields
Next: WordPress fields