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 can I catch WordPress custom settings page slug has already changed?
- Can i put my shortcode inside a variable in php files?
- Echo a function inside a function
- Download full html page with CSV export plugin
- Use .php file as page instead of wordpress page & template file?
- Display most popular posts of category
- How to combine 2 php functions into one function with a custom field
- PHP include is only working in certain places in my custom WP theme
- Remove the last X characters of a custom field value
- How to redirect users based on role and content of redirect_to?
- Plugin PHP file gives error 500 [closed]
- Excecuting php function in shortcode
- Advanced Custom Fields – display label and value only if value entered
- Only first shortcode gets executed
- Use WordPress function in php file
- How to correctly add Javascript to this PHP ‘Page Not Found’ Page?
- get_users meta_query: REGEXP not working for matching new lines
- Is it possible to retrieve all posts with a certain value for metadata?
- Correct and safe way to include php content in my page
- Revoke Access to certain user roles and admin pages
- Adding wrapper elements in the_date() like in the_title()?
- Get post id within comments loop
- Moving code from theme header to functions.php
- Change CSS based on is_user_logged_in
- Woocommerce change prices for a certain country [closed]
- What does this mean in wordpress? Easy question
- Adding PHP in the menu
- Adding `post_author` in php
- How to keep empty fields from appearing in php?
- Advanced Custom Fields not displaying
- Two menus show up
- How to get private property in parent class into extended class?
- Is this spyware on my site or a real Java update?
- meaning of (array)function()
- Multiple do_shortcode in page template
- How to get all author posts outside of author templates
- How to obtain the current website URL in my theme?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- How to determine if the sidebar is empty? Or not active?
- What exactly do this function declared into functions.php file of a WP theme?
- retrieve post data and insert it in seperate static html page without WordPress
- PHP conditional script issue
- How to display login form anywhere, when user isn’t logged in, without redirecting?
- WP_Query fails despite having 1 post
- Ajax contact form return 0
- How can I call specific function if requested URL is not found?
- Conditional Javascript based on WP Version