I'm using the plugin Custom CSS JS which registers it's own post type but the capability is assigned to "post"
.
I want to change it to "manage_options"
.
Is there a correct way without altering the plugin to do that? Calling a hook, a function or whatever?
public function register_post_type() {
$labels = array (
'name' => _x( 'Custom Code', 'post type general name' ),
'singular_name' => _x( 'Custom Code', 'post type singular name' ),
'menu_name' => _x( 'Custom CSS & JS', 'admin menu' ),
'name_admin_bar' => _x( 'Custom Code', 'add new on admin bar' ),
'add_new' => _x( 'Add Custom Code', 'add new' ),
'add_new_item' => __( 'Add Custom Code' ),
'new_item' => __( 'New Custom Code' ),
'edit_item' => __( 'Edit Custom Code' ),
'view_item' => __( 'View Custom Code' ),
'all_items' => __( 'All Custom Code' ),
'search_items' => __( 'Search Custom Code' ),
'parent_item_colon' => __( 'Parent Custom Code:' ),
'not_found' => __( 'No Custom Code found.' ),
'not_found_in_trash' => __( 'No Custom Code found in Trash.' ),
);
$args = array (
'labels' => $labels,
'description' => __( 'Custom CSS and JS code' ),
'public' => false,
'publicly_queryable' => false,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 100,
'menu_icon' => 'dashicons-plus-alt',
'query_var' => false,
'rewrite' => array ( 'slug' => 'custom-css-js' ),
'capability_type' => 'post', // <--- I want to manipulate this
'has_archive' => true,
'hierarchical' => false,
'exclude_from_search' => true,
'menu_position' => null,
'can_export' => false,
'supports' => array ( 'title' ),
);
register_post_type( 'custom-css-js', $args );
}
The above code is in custom-css-js.php
lines 200-239
.