Created
June 11, 2019 15:29
-
-
Save MjHead/871d731160a2cdf441c251701b599c8d to your computer and use it in GitHub Desktop.
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 | |
| add_filter( 'jet-engine/listings/allowed-callbacks', 'jet_add_calc_callback', 10, 2 ); | |
| function jet_add_calc_callback( $callbacks ) { | |
| $callbacks['jet_calc_fileds'] = 'Calculated field example'; | |
| return $callbacks; | |
| } | |
| function jet_calc_fileds( $field_1_value ) { | |
| return $field_1_value * get_post_meta( get_the_ID(), 'field_2' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
How do I format the returned number fomat? I want to change the decimal separator from "." to ",", and need to limit decimals to 2.
Thanks.