Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created November 6, 2020 05:10
Show Gist options
  • Select an option

  • Save yousufansa/8082dde57b93e1734a09262d3e92ae8f to your computer and use it in GitHub Desktop.

Select an option

Save yousufansa/8082dde57b93e1734a09262d3e92ae8f to your computer and use it in GitHub Desktop.
Jobhunt - Resume Contact Visibility Issue Fix
if ( ! function_exists( 'jobhunt_candidate_socail_network' ) ) {
function jobhunt_candidate_socail_network() {
global $post;
if( resume_manager_user_can_view_contact_details( $post->ID ) && ( ! empty( get_the_candidate_twitter_page() || get_the_candidate_facebook_page() || get_the_candidate_googleplus_page() || get_the_candidate_linkedin_page() || get_the_candidate_instagram_page() || get_the_candidate_youtube_page() || get_the_candidate_behance_page() || get_the_candidate_pinterest_page() || get_the_candidate_github_page() ) ) ) :
echo '<div class="social-network-pages">';
do_action( 'get_jobhunt_candidate_socail_network' );
echo '</div>';
endif;
}
}
if ( ! function_exists( 'jobhunt_candidate_info' ) ) {
function jobhunt_candidate_info() {
global $post;
?>
<div class="candidate-info">
<div class="candidate-image">
<?php the_candidate_photo(); ?>
</div>
<h4 class="candidate-name"><?php echo apply_filters( 'jobhunt_candidate_name', get_the_title() ); ?></h4>
<p class="job-title"><?php echo apply_filters( 'jobhunt_candidate_title', get_the_candidate_title() ); ?></p>
<?php if( resume_manager_user_can_view_contact_details( $post->ID ) && get_post_meta( $post->ID, '_candidate_email', true ) ) : ?>
<p class="candidate-e-mail"><a href="mailto:<?php echo get_post_meta( $post->ID, '_candidate_email', true ); ?>"><i class="la la-envelope"></i><?php echo get_post_meta( $post->ID, '_candidate_email', true ); ?></a></p>
<?php endif;
jobhunt_the_resume_links(); ?>
</div>
<?php
}
}
if ( ! function_exists( 'jobhunt_candidate_location' ) ) {
function jobhunt_candidate_location() {
global $post;
if( resume_manager_user_can_view_contact_details( $post->ID ) && ! empty( get_the_candidate_location() ) ) : ?>
<div class="location"><i class="la la-map-marker"></i><?php the_candidate_location(); ?></div>
<?php endif;
}
}
if ( ! function_exists( 'jobhunt_the_resume_file' ) ) {
function jobhunt_the_resume_file() {
global $post;
$resume_files = get_post_meta( $post->ID, '_resume_file', true );
if ( resume_manager_user_can_view_contact_details( $post->ID ) && ! empty( $resume_files ) && apply_filters( 'resume_manager_user_can_download_resume_file', true, $post->ID ) ) {
echo '<div class="candidate-resume">';
$resume_files = is_array( $resume_files ) ? $resume_files : array( $resume_files );
foreach ( $resume_files as $key => $resume_file ) : ?>
<a rel="nofollow" target="_blank" href="<?php echo esc_url( get_resume_file_download_url( null, $key ) ); ?>"><?php echo esc_html__( 'Download CV', 'jobhunt' ); ?><i class="la la-download"></i></a>
<?php endforeach;
echo '</div>';
}
}
}
if ( ! function_exists( 'jobhunt_the_resume_links' ) ) {
function jobhunt_the_resume_links() {
global $post;
if ( resume_manager_user_can_view_contact_details( $post->ID ) && resume_has_links() ) : ?>
<ul class="resume-links">
<?php foreach( get_resume_links() as $link ) : ?>
<?php get_job_manager_template( 'content-resume-link.php', array( 'post' => $post, 'link' => $link ), 'wp-job-manager-resumes', RESUME_MANAGER_PLUGIN_DIR . '/templates/' ); ?>
<?php endforeach; ?>
</ul>
<?php endif;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment