I have registered a custom post type and I want to unapprove comments by default on this custom post type without affecting the default posts/pages which is set to approve.
I've looked through the CODEX but I can not find anything related to what I'm trying to do.
I've found just how can I display the un-approved comments. Code for registering custom post type:
// Register Custom Post Type
function debate_post_type() {
$labels = array(
'name' => _x( 'Debates', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Debate', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Debate', 'text_domain' ),
'parent_item_colon' => __( 'Parent Debate:', 'text_domain' ),
'all_items' => __( 'All Debates', 'text_domain' ),
'view_item' => __( 'View Debate', 'text_domain' ),
'add_new_item' => __( 'Add New Debate', 'text_domain' ),
'add_new' => __( 'New Debate', 'text_domain' ),
'edit_item' => __( 'Edit Debate', 'text_domain' ),
'update_item' => __( 'Update Debate', 'text_domain' ),
'search_items' => __( 'Search debates', 'text_domain' ),
'not_found' => __( 'No debates found', 'text_domain' ),
'not_found_in_trash' => __( 'No debates found in Trash', 'text_domain' ),
);
$args = array(
'label' => __( 'debate', 'text_domain' ),
'description' => __( 'Here you can post your debates', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => '',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'debate', $args );
}
// Hook into the 'init' action
add_action( 'init', 'debate_post_type', 0 );
Any suggestions on how can I do this ? Thanks!