If you set a condition against a Number field, you can define the step value for the condition value. By default, the condition uses whole numbers. If you want to use decimals, you can use the following snippet:
This file contains hidden or 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 | |
/** | |
* Filter the step value for number fields in conditions | |
*/ | |
function tester_condition_value_step( $step, $field_id ) { | |
return 0.01; | |
} | |
add_filter( 'pewc_condition_value_step', 'tester_condition_value_step', 10, 2 ); |
Here’s how to use a snippet.