我已经注册了一个自定义帖子类型,我想在默认情况下取消对该自定义帖子类型的评论审批,而不影响设置为审批的默认帖子/页面。
我已经看过了抄本,但找不到任何与我想做的事情相关的东西。
我找到了如何显示未经批准的评论。注册自定义帖子类型的代码:
// 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 );
有什么建议吗?谢谢