'min', 'type' => 'number', 'label' => __( 'Smallest allowed', '2ranq-forms' ), ); $settings['basic'][] = array( 'key' => 'max', 'type' => 'number', 'label' => __( 'Largest allowed', '2ranq-forms' ), ); $settings['advanced'][] = array( 'key' => 'step', 'type' => 'number', 'label' => __( 'Step', '2ranq-forms' ), 'help' => __( 'Use 0.01 to allow decimals.', '2ranq-forms' ), ); return $settings; } /** * Prints the field. * * @param array $field The field settings. * @param int $form_id The form id. * * @return void */ public function render( $field, $form_id ) { $describedby = $this->describedby( $field, $form_id ); $has_min = isset( $field['min'] ) && '' !== $field['min']; $has_max = isset( $field['max'] ) && '' !== $field['max']; // After a failed send the visitor's number comes back instead of a blank box. $sticky = $this->sticky_value( $field, $form_id ); ?>
wrapper_data( $field ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped in wrapper_data().?>> render_label( $field, $form_id ); ?> value="" min="" max="" step="" aria-describedby="" /> render_description( $field, $form_id ); ?>
(float) $field['max'] ) { return sprintf( /* translators: %s: largest allowed number. */ __( 'Please enter a number no larger than %s.', '2ranq-forms' ), (string) $field['max'] ); } return ''; } }