ZillowReviews_Settings::number( array $args )
Callback function to display setting number field.
Contents
Parameters Parameters
- $args
-
(array) (Required) array of setting arguments
Source Source
File: mortgage-zillow-review/inc/ZillowReviews_Settings.php
public function number( array $args ) {
$name = $args['label_for'];
$option_name = $args['option_name'];
$input = get_option( $option_name );
$placeholder = $args['placeholder'];
$default = $args['default'];
$description = $args['description'];
$value = ! empty( $input[ $name ] ) ? $input[ $name ] : $default;
echo '<input style="width: 100%; padding: 5px 10px" type="number" class="regular-text" min="0" max="10" step="1" id="'
. esc_attr( $name ) . '" name="' . esc_attr( $option_name ) . '['
. esc_attr( $name ) . ']" value="' . esc_attr( $value )
. '" placeholder="' . esc_attr( $placeholder ) . '" >';
echo '<p>' . esc_html( $description ) . '</p>';
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |