WordPress: Disable “Add New” on Custom Post Type

前端 未结 10 922
执笔经年
执笔经年 2020-12-07 14:58

Is there any way to disable the option of adding a new post under a Custom Post Type in WordPress (3.0)? I\'ve looked into labels and arguments but can\'t find anything that

10条回答
  •  借酒劲吻你
    2020-12-07 15:07

    As the question is 'how to disable add-new button on custom post type', and not 'how to restrict user editing custom post types', in my opinion the answer should be purely hiding the buttons with css, by adding this to the functions.php file :

    add_action( 'admin_head', function(){
        ob_start(); ?>
        
    

提交回复
热议问题