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 would resemble such a feature.
相关问题
- Display product ACF field value in Woocommerce tra
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
- Setting custom order statuses as valid for payment
- change the font size in tag cloud
相关文章
- wordpress新增页面如何个性化设置
- select query in wordpress
- Get WooCommerce featured products in a WP_Query
- Woocommerce update shipping methods in checkout vi
- Change order status just after payment in WooComme
- Publishing or uploading failed. Error message: “Th
- Facebook Login With WP JWT Auth
- Wordpress development process
I hope it will help you. Many thanks !
Full credit to Seamus Leahy
May I ask why you want to do this?I would at first have suggested changing the capabilities for your custom post type, but I don't think there's one that limits who can add posts, but only who can edit or publish them.It looks a little dirty, but you could try unsetting the item in the$submenu
global;@ Staffan Estberg,
This is best way to hide the Add New or Create New button in custom postypes
It disable to create new post in custom post types both side in admin menu and above the list of post type.
There is a meta capability
create_posts
that is not documented but is used by WordPress to check before inserting the various 'Add New' buttons and links. In your custom post type declaration, addcapabilities
(not to be confused withcap
) and then set it tofalse
as below.