@PieterGoosen is cool, and still awake like me and answering like boss.
To simplify his code and make it work to this specifically without a bunch of junk on your page:
/**
* Pieter Goosen writes awesome code
*/
add_filter( 'register_post_type_args', 'change_capabilities_of_the_custom_css_js_posttype' , 10, 2 );
function change_capabilities_of_the_custom_css_js_posttype( $args, $post_type ){
// Do not filter any other post type
if ( 'custom-css-js' !== $post_type ) {
// Give other post_types their original arguments
return $args;
}
// Change the capability_type of the "custom-css-js" post_type
$args['capability_type'] = 'manage_options';
// Give the custom-css-js post type it's arguments
return $args;
}
The plugin you have chosen is written in a broad way. It has some insecurities.
Related Posts:
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Multiple useres editing specified content
- Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu
- Capabilities and Custom Post Types
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- Create a custom archive page for a custom post type in a plugin
- Media library – Limit images to custom post type
- Custom post type role permissions won’t let me read
- Allowing custom role access to custom post type in back end
- How to Add Custom Taxonomy To Woocommerce Plugin
- Development of a WordPress Search Plugin – Best Practices
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- How to assign specific users the capability to edit specific pages / posts / custom post types
- Allow user to Edit Posts but not Add New?
- Defining capabilities for custom post type
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Can I make user role that can only access a certian content type?
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- echo value from ‘select’ field type into page template using cmb2?
- REST API: How can I restrict a custom post type to only be accessible by authenticated users?
- Customize users’ capabilities to change a custom post’s post status
- register_taxonomy with multiple object type and update_count_callback
- Notice: map_meta_cap was called incorrectly
- How often do you need to register_post_type?
- Create user role restricted to specific CPT
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Custom Post Types – Capability Type
- post_type_link filter causes 404 on the CPT page it’s used on
- How to use a dedicated template for the Custom Post Type from a plugin?
- Custom Post Type Capabilities — Enable Edit, Disable Create and Delete
- How to not allow custom roles to edit published custom post types?
- When you create a custom post type, does that also create capabilities for editing/deleting that post type automatically?
- Include images from pages in wp search.php results in default wp search
- Using Custom Meta Capabilities on Custom Post Type
- Separating Search Results By Post Type
- List events by month
- Date query for a custom meta field
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Change plugin’s has_archive = true to false?
- Getting arguments for register_post_type from a plugin generated post type
- How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- Remove POST_TYPE from custom post type permalink
- Query posts between two dates (custom meta keys) CMB2
- How to localize value of posts
- Used with meta_query in query_posts works slowly
- WordPress capability_type arguments
- Change upload_dir folder at a certain cpt but cant change back
- How to add post_author column to custom post type
- How to register custom post types in a plugin?
- Display custom taxonomy as dropdown list
- Custom role capabilities to administrator not taking effect (no plugin)
- Prevent author role from editing all posts in custom post type?
- Allow Users Access to Custom Post Type Only
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- How to append element after thumbnail
- Best practice for adding posts in bulk
- Custom Role can’t trash Custom Post Type
- Limit access to page depending on user level
- Role Capabilities: Add New Ones?
- Hide Meta Boxes for Non-Admins
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Notice: Undefined property: stdClass::$delete_posts with custom post type
- Custom Role for CPT Only
- Issue to get wp_get_attachment_image with cmb2
- How to have the right design for a custom post type without accessing themes
- Add custom capabilities to existing custom post type
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- allow edit of custom post type but not regular posts?
- Allow Administrator role access to custom capabilities [duplicate]
- Custom Post Type | Fatal Error on register_post_type()
- Set object terms not working on plugin activation
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- GravityForm: Populate Dropdown with custom post type [closed]
- how to add extra meta box or textarea into custom post types
- Why is my Custom Post Type not showing up after adding capabilities?
- “add_post_type_support” with Custom Post Type & ACF
- Shortcode insertion in tab
- Cannot attach media when capabilities added to custom post type
- Can’t get order_by meta_value_num to work properly
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Add CPT as subpage under custom page
- Link two different post using there post_id in post meta
- Custom post type that lets users create a set of posts?
- Include images from pages in wp search.php results in default wp search
- Capibilities of CPT WordPress
- How can I remove “Add new” button on custom post type
- Create Inclusions and exclusions
- How to create groups like that in buddypress?
- Post that populates itself (almost) automatically using data from imported excel file
- I broke it! Custom post type archive gets redirected to home
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Capabilities and mapping required for a role to be able to edit other’s posts of a custom type, BUT only be able to edit their own blog posts
- Custom Fields through plugin in a Custom Post Type
- Can’t save custom post type fields
- Enable shortcodes on custom post type