diff --git a/classes/fields.class.php b/classes/fields.class.php index 2dfad25..787dfeb 100644 --- a/classes/fields.class.php +++ b/classes/fields.class.php @@ -355,6 +355,7 @@ function render_all_input_types( $name, $data, $fields_type, $field_index, $valu $options = ( isset( $data ['options'] ) ? $data ['options'] : '' ); $placeholders = isset( $data['placeholders'] ) ? $data['placeholders'] : ''; + $types = isset( $data['types'] ) ? $data['types'] : ''; $existing_name = 'name="ppom[' . esc_attr( $field_index ) . '][' . esc_attr( $name ) . ']"'; @@ -439,6 +440,13 @@ function render_all_input_types( $name, $data, $fields_type, $field_index, $valu ); $plc_stock = ( isset( $placeholders[5] ) && ! empty( $placeholders ) ) ? $placeholders[5] : __( 'Stock', 'woocommerce-product-addon' ) . ' (' . __( 'PRO only', 'woocommerce-product-addon' ) . ')'; + $option_type = ( isset( $types[0] ) && ! empty( $types[0] ) ) ? sanitize_text_field( $types[0] ) : 'text'; + $price_type = ( isset( $types[1] ) && ! empty( $types[1] ) ) ? sanitize_text_field( $types[1] ) : 'text'; + $discount_type = ( isset( $types[2] ) && ! empty( $types[2] ) ) ? sanitize_text_field( $types[2] ) : 'text'; + $tooltip_type = ( isset( $types[3] ) && ! empty( $types[3] ) ) ? sanitize_text_field( $types[3] ) : 'text'; + $weight_type = ( isset( $types[4] ) && ! empty( $types[4] ) ) ? sanitize_text_field( $types[4] ) : 'text'; + $stock_type = ( isset( $types[5] ) && ! empty( $types[5] ) ) ? sanitize_text_field( $types[5] ) : 'text'; + if ( ppom_pro_is_installed() ) { $plc_discount = ( isset( $placeholders[2] ) && ! empty( $placeholders ) ) ? $placeholders[2] : __( 'Discount', 'woocommerce-product-addon' ); @@ -470,16 +478,16 @@ function render_all_input_types( $name, $data, $fields_type, $field_index, $valu $option_id = ppom_get_option_id( $option ); $html_input .= '
  • '; $html_input .= ''; - $html_input .= ''; - $html_input .= ''; + $html_input .= ''; + $html_input .= ''; if ( $fields_type === 'checkbox' ) { - $html_input .= ''; - $html_input .= ''; + $html_input .= ''; + $html_input .= ''; } - $html_input .= ''; - $html_input .= ''; + $html_input .= ''; + $html_input .= ''; $html_input .= ''; $html_input .= ''; @@ -494,16 +502,16 @@ function render_all_input_types( $name, $data, $fields_type, $field_index, $valu } else { $html_input .= '
  • '; $html_input .= ''; - $html_input .= ''; - $html_input .= ''; + $html_input .= ''; + $html_input .= ''; if ( $fields_type === 'checkbox' ) { - $html_input .= ''; - $html_input .= ''; + $html_input .= ''; + $html_input .= ''; } - $html_input .= ''; - $html_input .= ''; + $html_input .= ''; + $html_input .= ''; $html_input .= '';