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 | |
/** | |
* Save Resume Meta | |
* | |
* @param mixed $post_id | |
* @param mixed $post | |
*/ | |
public function save_resume_data( $post_id, $post ) { | |
global $wpdb; |
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
add_filter ( 'get_job_listings_query_args', 'unstick_featured_jobs' ); | |
function unstick_featured_jobs( $query_args ) { | |
$query_args['orderby'] = 'date'; | |
$query_args['order'] = 'DESC'; | |
return $query_args; | |
} |
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
function listing_published_send_email($post_id) { | |
if( 'job_listing' != get_post_type( $post_id ) ) { | |
return; | |
} | |
$post = get_post($post_id); | |
$author = get_userdata($post->post_author); | |
$message = " | |
Hi ".$author->display_name.", | |
Your listing, ".$post->post_title." has just been approved at ".get_permalink( $post_id ).". Well done! |
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
function job_listing_post_type_link( $permalink, $post ) { | |
// Abort if post is not a job | |
if ( $post->post_type !== 'job_listing' ) | |
return $permalink; | |
// Abort early if the placeholder rewrite tag isn't in the generated URL | |
if ( false === strpos( $permalink, '%' ) ) | |
return $permalink; | |
// Get the custom taxonomy terms in use by this post |
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
// Add to theme functions.php | |
add_filter( 'job_manager_geolocation_endpoint', 'change_geocode_lang' ); | |
function change_geocode_lang( $endpoint ) { | |
// Use language from https://developers.google.com/maps/faq#using-google-maps-apis | |
return add_query_arg( 'language', 'en-GB', $endpoint ); | |
} |
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
// Add to theme functions.php | |
add_filter( 'job_manager_geolocation_endpoint', 'change_geocode_lang' ); | |
function change_geocode_lang( $endpoint ) { | |
// Use language from https://developers.google.com/maps/faq#using-google-maps-apis | |
return add_query_arg( 'language', 'en-GB', $endpoint ); | |
} |
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
function custom_job_post_type_link( $post_id, $post ) { | |
// don't add the id if it's already part of the slug | |
$permalink = $post->post_name; | |
if ( strpos( $permalink, strval( $post_id ) ) ) { | |
return; | |
} | |
// unhook this function to prevent infinite looping | |
remove_action( 'save_post_job_listing', 'custom_job_post_type_link', 10, 2 ); |
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
function listing_expired_send_email($post_id) { | |
$post = get_post($post_id); | |
$author = get_userdata($post->post_author); | |
$message = " | |
Hi ".$author->display_name.", | |
Your listing, ".$post->post_title." has now expired: ".get_permalink( $post_id ); | |
wp_mail($author->user_email, "Your job listing has expired", $message); | |
} | |
add_action('expired_job_listing', 'listing_expired_send_email'); |
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
// Remove company name | |
add_filter( 'submit_job_form_prefix_post_name_with_company', '__return_false' ); | |
// Remove location | |
add_filter( 'submit_job_form_prefix_post_name_with_location', '__return_false' ); | |
// Remove job type | |
add_filter( 'submit_job_form_prefix_post_name_with_job_type', '__return_false' ); |
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 global $post; ?> | |
<div class="single_job_listing" itemscope itemtype="http://schema.org/JobPosting"> | |
<meta itemprop="title" content="<?php echo esc_attr( $post->post_title ); ?>" /> | |
<?php if ( get_option( 'job_manager_hide_expired_content', 1 ) && 'expired' === $post->post_status ) : ?> | |
<div class="job-manager-info"><?php _e( 'This listing has expired.', 'wp-job-manager' ); ?></div> | |
<?php else : ?> | |
<?php | |
/** | |
* single_job_listing_start hook |