'scale', 'type' => 'number', 'label' => __( 'How many stars', '2ranq-forms' ), 'help' => __( 'Between 2 and 10. Five is usual.', '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 ); $base = $this->input_id( $field, $form_id ); $scale = $this->scale( $field ); // After a failed send the visitor's stars come back instead of none. $sticky = $this->sticky_value( $field, $form_id ); ?>
$this->scale( $field ) ) { return __( 'Please choose one of the available options.', '2ranq-forms' ); } return ''; } /** * How it is shown in the entry. * * @param mixed $value The value. * @param array $field The field settings. * * @return string */ public function format_value( $value, $field ) { if ( '' === (string) $value ) { return ''; } return (int) $value . ' / ' . $this->scale( $field ); } }