Skip to content

Instantly share code, notes, and snippets.

@purethemes
Last active October 9, 2023 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purethemes/fa733afa6c2f57ef8aeecec11612cb14 to your computer and use it in GitHub Desktop.
Save purethemes/fa733afa6c2f57ef8aeecec11612cb14 to your computer and use it in GitHub Desktop.
Hide "apply for job" button for employers in WP Job Manager
<?php
add_filter('job_manager_candidates_can_apply','block_employer_applying');
function block_employer_applying($can_apply ){
$current_user = wp_get_current_user();
$user_id = get_current_user_id();
$roles = $current_user->roles;
$role = array_shift( $roles );
if($role == 'employer' ) {
$can_apply = false;
} else {
$can_apply = true;
}
return $can_apply;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment