When you register your post type you can show/hide the UI in the arguments. I would approach it this way:
$allowed = current_user_can('administrator') ? true : false;
$args = array(
//other args
'show_ui' => $allowed
);
//register_post_type() function;
This will maintain the custom post type architecture while hiding the UI for those who are not administrators. For more information about WordPress User Capabilities see this page: http://codex.wordpress.org/Roles_and_Capabilities
Related Posts:
- Remove update nags for non-admins [duplicate]
- Any guides on creating custom admin pages?
- Remove Customize Background and Header from Appearance admin menu without CSS or JS
- renaming an admin menu item with decimal array index number
- Jquery no more loading, load-scripts.php not found (404)
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- Handling error states with admin_post
- Installing wp3.2.1 on IIS; getting empty sessions
- Adding Field to Profile “Name”
- Admin Menus – Name Menu different from first Submenu [duplicate]
- Add a Custom Class to Admin Menus
- When is is_admin() available?
- Creating a new page and automatically associating it with a template in WordPress
- Unable to set right time in admin and frontend template
- List User order by ID in Descending order (Backend)
- Why is this Ajax not working?
- Admin Options page. Save as Array
- WooCommerce – Email admin with new user details
- Correct folder permissions?
- Selectbox in admin panel function linking to CSS
- Sort custom meta column by other meta value
- running wp-cron.php using php not wget
- Programmatically create page when saving custom post type post
- Building a WordPress App
- How can I open up my administrative panel to everyone?
- retain querystring values when savincustom options in admin
- Get categories names as an array to use it in theme settings
- Get Page ID from Backend
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Removing custom sort order from admin page listing
- I installed WordPress locally now how do I login?
- Adding a ‘style=’ bit to image_send_to_editor output
- Get options from database using php class
- In PHP how do I make my navigation bar show certain links to admins only?
- Woocommerce display orders with products from specific categories to specific admins
- PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
- admin panel – How to remove “delete” button from category editing page
- wordpress email checker on domain
- problem connecting to the administrator
- How to add a DELETE button to the “Edit User” WordPress admin page?
- Editing the term_order field
- Access to “My Site” is missing from the admin bar
- wordpress ajax return 0
- Dynamic form variables for post meta
- Include administrator in author list
- Shortcodes (with a space) added to php Sample
- Image not displayed
- Adding Media button to only pages
- Forbid certain users to access a specific page
- One folder to be accessible by one user
- Exclude Everywhere but Admin Area?
- AJAX WP_Query’s order and orderby parameters not working
- How to add date range in woocommerce with code
- Is it possible to generate a page without create in the admin?
- Admin Media grid view images won’t load
- WordPress remove EXIF Data from specific Thumb
- How to redirect all 404 in a WordPress subdirectory to the index.php of subdirectory?
- Should I store my Facebook access tokens?
- When must I use and verify nonce?
- Filter get_the_title to remove certain characters?
- Displaying a button on each post
- Store records for a table in wordpress
- Slider loading issue
- WooCommerce Related Products by Attribute
- Sort posts by custom fields value using dropdown menu
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Cause of Blank Lines Being Added to WP FIles?
- Limit Widgets to Sidebar ID’s
- Weird 404 URL Problem – domain name being placed at end of urls
- Trouble checking if custom woocommerce checkout field is empty or not
- Where can I find the inline-css of my theme header?
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Call WC_Product get_price()?
- page 1 is not paged
- How do I call an external php non WordPress class into functions.php?
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- Error establishing a database connection (configuration)
- How to display only specific Error types in debug.log? No notices, warnings, etc
- Converting Array to String Issue [closed]
- ElseIf Statement with ACF Group field
- How to change href of a Widget menu item link?
- Populate Posts based on category selected using AJAX that means without page refresh
- random woocommerce categories are not showing when count enabled?
- Can’t get_users info by using json_encode
- Newbie question. Login/Registration. New PHP page
- Submit to itself don’t work
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Can someone help me edit the code for limiting image dimensions
- WordPress site cant display media when it’s live
- Removing all my hardcoded URLs with get_site_url()
- Highlight main menu when on specific posts or pages
- Submenu opened problem
- wc_add_notice not working on cart page
- How to convert my comment.html to comment.php
- It’s not showing full content for posts pages in wordpress “[…]” while customing some changes in the style.css file [closed]
- How do I convert a custom field to a php date format? [closed]
- append special url end of my website urls
- Tags being Inserted in html from plugin PHP not passing through the_content