Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created January 28, 2019 07:07
Show Gist options
  • Save yousufansa/e76764da23d07b4c8c0e6166dc145c7b to your computer and use it in GitHub Desktop.
Save yousufansa/e76764da23d07b4c8c0e6166dc145c7b to your computer and use it in GitHub Desktop.
Jobhunt - Post A Job Button On Administrator / Employer
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