Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Last active February 12, 2020 10:55
Show Gist options
  • Save mikejolley/bcb1d47f50aea6f2c0d9 to your computer and use it in GitHub Desktop.
Save mikejolley/bcb1d47f50aea6f2c0d9 to your computer and use it in GitHub Desktop.
WP Job Manager - Make Job Location a required field
add_filter( 'submit_job_form_fields', 'make_location_field_required' );
function make_location_field_required( $fields ) {
$fields['job']['job_location']['required'] = true;
return $fields;
}
@adamgaik123
Copy link

Hello, could you please tell me, where to put this? Functions.php? Thank you in advance for an answer! Best

@nszumowski
Copy link

Just what I was looking for, thanks for the gist!

@pranali333
Copy link

To whoever, wondering where to put this code:

While you can add it directly to your theme's functions.php file, I'd personally recommend to install Code Snippets: https://wordpress.org/plugins/code-snippets/ and add the piece of code there.
Thank you!

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