需要关闭招聘平台的评论功能,原因很简单,就是发现其实没必要开启评论,以下是开启简历和招聘信息评论的方法。
// Add comment support to the post type
add_filter( 'register_post_type_job_listing', 'custom_register_post_type_job_listing' );
function custom_register_post_type_job_listing( $args ) {
$args['supports'][] = 'comments';
return $args;
}
// Add comment support to the post type
add_filter( 'register_post_type_resume', 'register_post_type_resume_enable_comments' );
function register_post_type_resume_enable_comments( $post_type ) {
$post_type['supports'][] = 'comments';
return $post_type;
}
// Make comments open by default for new job listing
add_filter( 'submit_job_form_save_job_data', 'custom_submit_job_form_save_job_data' );
function custom_submit_job_form_save_job_data( $args ) {
$args['comment_status'] = 'open';
return $args;
}
// Make comments open by default for new resumes
add_filter( 'submit_resume_form_save_resume_data', 'custom_submit_resume_form_save_resume_data' );
function custom_submit_resume_form_save_resume_data( $data ) {
$data['comment_status'] = 'open';
return $data;
}