/home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Forms/Fields/PaymentSelect
Edit: /home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Forms/Fields/PaymentSelect/Field.php (17326B)
name = esc_html__( 'Dropdown Items', 'wpforms-lite' );
$this->keywords = esc_html__( 'product, store, ecommerce, pay, payment', 'wpforms-lite' );
$this->type = 'payment-select';
$this->icon = 'fa-caret-square-o-down';
$this->order = 70;
$this->group = 'payment';
$this->defaults = [
1 => [
'label' => esc_html__( 'First Item', 'wpforms-lite' ),
'value' => '10',
'default' => '',
],
2 => [
'label' => esc_html__( 'Second Item', 'wpforms-lite' ),
'value' => '25',
'default' => '',
],
3 => [
'label' => esc_html__( 'Third Item', 'wpforms-lite' ),
'value' => '50',
'default' => '',
],
];
$this->default_settings = [
'choices' => $this->defaults,
];
$this->hooks();
}
/**
* Register hooks.
*
* @since 1.8.2
*/
private function hooks() {
// Define additional field properties.
add_filter( "wpforms_field_properties_{$this->type}", [ $this, 'field_properties' ], 5, 3 );
// Form frontend CSS enqueues.
add_action( 'wpforms_frontend_css', [ $this, 'enqueue_frontend_css' ] );
// Form frontend JS enqueues.
add_action( 'wpforms_frontend_js', [ $this, 'enqueue_frontend_js' ] );
// Customize HTML field value.
add_filter( 'wpforms_html_field_value', [ $this, 'field_html_value' ], 10, 4 );
}
/**
* Define additional field properties.
*
* @since 1.8.2
*
* @param array $properties Field properties.
* @param array $field Field settings.
* @param array $form_data Form data and settings.
*
* @return array
*/
public function field_properties( $properties, $field, $form_data ) {
// Remove primary input.
unset( $properties['inputs']['primary'] );
// Define data.
$form_id = absint( $form_data['id'] );
$field_id = absint( $field['id'] );
$choices = $field['choices'];
// Set options container (