Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable comments on job listings
// 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