Created
September 4, 2017 12:26
-
-
Save davoraltman/d8be23247e6631ac89a8eb74b04ab5e1 to your computer and use it in GitHub Desktop.
Enable comments on job listings
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 comment support to the job listing post type - you'll need to enable the comments for old listings manually | |
add_filter( 'register_post_type_job_listing', 'register_post_type_job_listing_enable_comments' ); | |
function register_post_type_job_listing_enable_comments( $post_type ) { | |
$post_type['supports'][] = 'comments'; | |
return $post_type; | |
} | |
// Make comments open by default for new job listings | |
add_filter( 'submit_job_form_save_job_data', 'custom_submit_job_form_save_job_data' ); | |
function custom_submit_job_form_save_job_data( $job_data ) { | |
$job_data['comment_status'] = 'open'; | |
return $job_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment