Created
January 30, 2020 13:03
-
-
Save plugin-republic/ab25cfb282cee7a545661eae9a6f1381 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Filter our field params before they're saved | |
* In this case, set a calculation field with the ID 4991 to be flat rate | |
* @requires 3.4.3 and greater | |
*/ | |
function prefix_before_update_field_all_params( $all_params, $field_id ) { | |
if( $field_id == 4991 ) { | |
$all_params['field_flatrate'] = 1; | |
} | |
return $all_params; | |
} | |
add_filter( 'pewc_before_update_field_all_params', 'prefix_before_update_field_all_params', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment