Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_format_checkbox( $value, $field_type, $field ) {
- if ( $value == 'Yes' ) {
- $value = true;
- } elseif ( $value == 'No' ) {
- $value = false;
- }
- return $value;
- }
- add_filter( 'wpf_format_field_value', 'custom_format_checkbox', 20, 3 );
- function wpf_load_checkboxes_yes_no( $user_meta, $user_id ) {
- foreach ( $user_meta as $key => $value ) {
- if ( $value === true ) {
- $user_meta[ $key ] = 'Yes';
- } elseif ( $value === null ) {
- $user_meta[ $key ] = 'No';
- }
- }
- return $user_meta;
- }
- add_filter( 'wpf_pulled_user_meta', 'wpf_load_checkboxes_yes_no', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement