';
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
break;
case 'recaptcha':
echo '';
break;
}
}
/**
* Open fields area container.
*
* @since 1.8.1
*/
public function fields_area_open() {
echo '
';
}
/**
* Close fields area container.
*
* @since 1.8.1
*/
public function fields_area_close() {
echo '
';
}
/**
* Open container for each field.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection HtmlUnknownAttribute
* @noinspection PhpUnusedParameterInspection
*/
public function field_container_open( $field, $form_data ) {
$container = $field['properties']['container'];
$container['data']['field-id'] = absint( $field['id'] );
printf(
'
',
wpforms_html_attributes( $container['id'], $container['class'], $container['data'], $container['attr'] )
);
}
/**
* Close container markup for each field.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
*/
public function field_container_close( $field, $form_data ) {
echo '
';
}
/**
* Open fieldset.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
*/
public function field_fieldset_open( $field, $form_data ) {
}
/**
* Close fieldset.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
*/
public function field_fieldset_close( $field, $form_data ) {
}
/**
* Field label.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection HtmlUnknownAttribute
* @noinspection PhpUnusedParameterInspection
*/
public function field_label( $field, $form_data ) {
if ( empty( $field['properties']['label'] ) ) {
return;
}
$label = $field['properties']['label'];
$required = $label['required'] ? wpforms_get_field_required_label() : '';
printf(
'',
wpforms_html_attributes( $label['id'], $label['class'], $label['data'], $label['attr'] ),
esc_html( $label['value'] ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$required
);
}
/**
* Field error.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection HtmlUnknownAttribute
* @noinspection PhpUnusedParameterInspection
*/
public function field_error( $field, $form_data ) {
if ( empty( $field['properties']['error'] ) ) {
return;
}
$error = $field['properties']['error'];
printf(
'',
wpforms_html_attributes( $error['id'], $error['class'], $error['data'], $error['attr'] ),
esc_html( $error['value'] )
);
}
/**
* Field description.
*
* @since 1.8.1
*
* @param array $field Field data and settings.
* @param array $form_data Form data and settings.
*
* @noinspection HtmlUnknownAttribute
* @noinspection PhpUnusedParameterInspection
*/
public function field_description( $field, $form_data ) {
if ( empty( $field['properties']['description'] ) ) {
return;
}
$description = $field['properties']['description'];
printf(
'
';
}
/**
* Open submit container.
*
* @since 1.8.1
*
* @param int $pages Information for multi-page forms.
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
* @noinspection HtmlUnknownAttribute
*/
public function submit_container_open( $pages, $form_data ) {
printf( '
', $pages ? 'style="display:none;"' : '' );
}
/**
* Submit button.
*
* @since 1.8.1
*
* @param int $form_id Form ID.
* @param string $submit Submit text.
* @param array $classes CSS classes.
* @param array $data_attrs Data attributes.
* @param array $attrs Other attributes.
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
*/
public function submit_button( $form_id, $submit, $classes, $data_attrs, $attrs, $form_data ) {
printf(
'',
wpforms_html_attributes(
sprintf( 'wpforms-submit-%d', absint( $form_id ) ),
$classes,
$data_attrs,
$attrs
),
esc_html( $submit )
);
}
/**
* Submit button.
*
* @since 1.8.1
*
* @param string $src Spinner image src attribute.
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
*/
public function submit_spinner( $src, $form_data ) {
printf(
'',
esc_url( $src ),
esc_attr__( 'Loading', 'wpforms-lite' )
);
}
/**
* Open submit container.
*
* @since 1.8.1
*
* @param array $form_data Form data and settings.
*
* @noinspection PhpUnusedParameterInspection
*/
public function submit_container_close( $form_data ) {
echo '