Created
October 4, 2018 16:22
-
-
Save yousufansa/52c32d34f70be0c44346da4820973321 to your computer and use it in GitHub Desktop.
Jobhunt Single Job Header Background Image
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
add_filter('submit_job_form_fields' , 'jobhunt_child_custom_submit_job_form_fields'); | |
if ( ! function_exists( 'jobhunt_child_custom_submit_job_form_fields' ) ) { | |
function jobhunt_child_custom_submit_job_form_fields ($fields) { | |
$fields['job']['job_header_bg_image'] = array( | |
'label' => esc_html__( 'Header Image', 'jobhunt' ), | |
'type' => 'file', | |
'placeholder' => 'Upload your header image', | |
'priority' => 5, | |
'required' => false | |
); | |
return $fields; | |
} | |
} | |
add_filter('job_manager_job_listing_data_fields' , 'jobhunt_child_custom_job_manager_job_fields'); | |
if ( ! function_exists( 'jobhunt_child_custom_job_manager_job_fields' ) ) { | |
function jobhunt_child_custom_job_manager_job_fields ($fields) { | |
$fields['_job_header_bg_image'] = array( | |
'label' => esc_html__( 'Header Image', 'jobhunt' ), | |
'placeholder' => 'Upload your header image', | |
'type' => 'file' | |
); | |
return $fields; | |
} | |
} | |
add_filter('jobhunt_get_wpjm_header_bg_img' , 'jobhunt_get_wpjm_single_header_bg_img'); | |
if ( ! function_exists( 'jobhunt_get_wpjm_single_header_bg_img' ) ) { | |
function jobhunt_get_wpjm_single_header_bg_img($bg_url) { | |
$post = get_post(); | |
if ( is_singular( 'job_listing' ) && !empty( $post->_job_header_bg_image ) ) { | |
$bg_url = $post->_job_header_bg_image; | |
} | |
return $bg_url; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment