Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PluginRepublicSupport/6fd962c28d0285777db889ae2d6c067c to your computer and use it in GitHub Desktop.
Save PluginRepublicSupport/6fd962c28d0285777db889ae2d6c067c to your computer and use it in GitHub Desktop.
Add your custom logic here to determine the input type
<?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