array( __( 'Street address', '2ranq-forms' ), 'street-address', true ), 'line2' => array( __( 'Apartment, suite, floor', '2ranq-forms' ), 'address-line2', true ), 'city' => array( __( 'City', '2ranq-forms' ), 'address-level2', false ), 'region' => array( __( 'Region', '2ranq-forms' ), 'address-level1', false ), 'postal' => array( __( 'Postal code', '2ranq-forms' ), 'postal-code', false ), 'country' => array( __( 'Country', '2ranq-forms' ), 'country-name', false ), ); } /** * The type. * * @return string */ public function get_type() { return 'address'; } /** * The name in the builder. * * @return string */ public function get_label() { return __( 'Address', '2ranq-forms' ); } /** * The icon. * * @return string */ public function get_icon() { return 'dashicons-location'; } /** * The group. * * @return string */ public function get_group() { return 'fancy'; } /** * The name the value arrives under. * * @param array $field The field settings. * * @return string */ protected function input_name( $field ) { return 'ranq_fields[' . $this->field_key( $field ) . ']'; } /** * 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 ); // After a failed send the visitor's address comes back instead of blank boxes. $sticky = $this->sticky_value( $field, $form_id ); ?>