Created
November 17, 2025 21:19
-
-
Save tripflex/a467508965eff64f13f94de55b7636b4 to your computer and use it in GitHub Desktop.
Allow zero (0) value fields in WP Job Manager when using WP Job Manager Field Editor
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( 'submit_job_form_validate_fields_empty_values', 'smyles_submit_job_form_validate_fields_empty_values', 99, 2); | |
| function smyles_submit_job_form_validate_fields_empty_values( $empty_values, $meta_key ){ | |
| // [ '', 0, 0.0, '0', null, false, [] ] is the default value (@see is_empty) | |
| return [ '', 0.0, null, false, [] ]; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative method for older versions or if this doesn't work:
https://gist.github.com/tripflex/fab8b3d33833ea6edb844722093e742e