Created
January 28, 2019 07:07
-
-
Save yousufansa/e76764da23d07b4c8c0e6166dc145c7b to your computer and use it in GitHub Desktop.
Jobhunt - Post A Job Button On Administrator / Employer
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
if ( ! function_exists( 'jh_child_header_post_a_job_button_for_employer' ) ) { | |
function jh_child_header_post_a_job_button_for_employer( $current_status ) { | |
$user = wp_get_current_user(); | |
if ( $current_status && is_user_logged_in() && ( in_array( 'employer', (array) $user->roles ) || in_array( 'administrator', (array) $user->roles ) ) ) { | |
return $current_status; | |
} else { | |
return false; | |
} | |
} | |
} | |
add_filter( 'jobhunt_header_post_a_job_button', 'jh_child_header_post_a_job_button_for_employer', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment