/home/techb158/balacoffee.com/wp-content/plugins/wpforms/pro/includes/fields
Edit: /home/techb158/balacoffee.com/wp-content/plugins/wpforms/pro/includes/fields/class-hidden.php (2284B)
name = esc_html__( 'Hidden Field', 'wpforms' );
$this->type = 'hidden';
$this->icon = 'fa-eye-slash';
$this->order = 210;
$this->group = 'fancy';
}
/**
* Field options panel inside the builder.
*
* @since 1.0.0
*
* @param array $field Field data and settings.
*/
public function field_options( $field ) {
/*
* Basic field options.
*/
// Options open markup.
$args = [
'markup' => 'open',
];
$this->field_option( 'basic-options', $field, $args );
// Label.
$this->field_option( 'label', $field );
// Set label to disabled.
$args = [
'type' => 'hidden',
'slug' => 'label_disable',
'value' => '1',
];
$this->field_element( 'text', $field, $args );
// Default value.
$this->field_option( 'default_value', $field );
// Custom CSS classes.
$this->field_option( 'css', $field );
// Options close markup.
$args = [
'markup' => 'close',
];
$this->field_option( 'basic-options', $field, $args );
}
/**
* Field preview inside the builder.
*
* @since 1.0.0
*
* @param array $field Field data and settings.
*/
public function field_preview( $field ) {
// Define data.
$default_value = ! empty( $field['default_value'] ) ? $field['default_value'] : '';
// Label.
$this->field_preview_option( 'label', $field );
// Primary input.
echo '
';
}
/**
* Field display on the form front-end.
*
* @since 1.0.0
*
* @param array $field Field data and settings.
* @param array $deprecated Not used any more field attributes.
* @param array $form_data Form data and settings.
*/
public function field_display( $field, $deprecated, $form_data ) {
// Define data.
$primary = $field['properties']['inputs']['primary'];
// Primary field.
printf(
'
',
wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] )
);
}
}
new WPForms_Field_Hidden();