Created
March 6, 2024 14:20
-
-
Save PluginRepublicSupport/6fd962c28d0285777db889ae2d6c067c to your computer and use it in GitHub Desktop.
Add your custom logic here to determine the input type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('pewc_number_field_input_type', 'range_number_field_input_type', 10, 3); | |
function range_number_field_input_type($input_type, $product_id, $item) | |
{ | |
// Check if the enable_range_slider is set to 'checked' | |
$enable_range_slider = isset( $item['enable_range_slider'] ) ? $item['enable_range_slider'] : ''; | |
if ($enable_range_slider == '1') { | |
return 'range'; | |
} | |
return $input_type; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment