Last active
October 9, 2023 06:25
-
-
Save purethemes/fa733afa6c2f57ef8aeecec11612cb14 to your computer and use it in GitHub Desktop.
Hide "apply for job" button for employers in WP Job Manager
This file contains 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('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