Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created November 17, 2025 21:19
Show Gist options
  • Select an option

  • Save tripflex/a467508965eff64f13f94de55b7636b4 to your computer and use it in GitHub Desktop.

Select an option

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
<?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, [] ];
}
@tripflex
Copy link
Author

Alternative method for older versions or if this doesn't work:
https://gist.github.com/tripflex/fab8b3d33833ea6edb844722093e742e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment