Title: Make Compatible With Our Plugins
Last modified: July 29, 2017

---

# Make Compatible With Our Plugins

 *  Resolved [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/)
 * How do I make our plugins and one of specific plugin [https://wordpress.org/plugins/lightbox-slider/](https://wordpress.org/plugins/lightbox-slider/)
   compatible with your plugin?
 * Lightbox Slider plugin is based on Custom Post Type.
 * Actually, one of our user wants to allow his authors(role) to create the gallery
   using Lightbox Slider. But, it’s facing some problem.
 * Here the thread – [https://wordpress.org/support/topic/lightbox-slider-and-custom-role-support/](https://wordpress.org/support/topic/lightbox-slider-and-custom-role-support/)
 * I have recommended your best plugin to this user.
 * Hope you help in this to configure the plugin according to the problem.
 * Thanks
    -  This topic was modified 8 years, 10 months ago by [Weblizar - WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/#post-9363769)
 * Hi,
 * Thanks for sharing information about User Role Editor and its Pro version.
 * In relation to your plugin user support request:
 * 1st, you define a ‘lightbox-slider’ custom post type with a capability type ‘
   page’. It automatically forces to grant to user all ‘%_pages’ capabilities in
   order such user has a full access to your galleries.
 * User Role Editor shows (0/0) for such custom post types as ‘edit_pages’, etc.
   capabilities are shown already for the built-in ‘Pages’ post type. There is no
   incompatibility issue here.
 * User Role Editor Pro has an option which allows to force custom post types to
   use own capabilities set instead of ‘post’ or ‘page’ built-in types related one.
   
   But this will resolve a problem just partially as there is the 2nd difficulty
   with providing to a user without administrator privileges a full access to your
   plugin.
 * 2nd, you add “Lightbox Slider” menu items with ‘administrator’ role instead of
   user capability. So only user with ‘administrator’ role can access “Lightbox 
   Slider->Settings” and other menu items.
 * I offer to replace ‘administrator’ in your menu definition with more fluent ‘
   manage_options’ or with your own custom capability, like ‘manage_lightbox_slider’.
   User with ‘manage_lightbox_slider’ will not get access to any other site and 
   some plugins settings like with ‘manage_options’ capability. Thus 2nd variant
   is more secure.
 * In order do not force “Lightbox Slider” users to buy User Role Editor Pro, and
   make your plugin more universal, you can define ‘lightbox-slider’ post type with
   own capabilities set from the scratch. Modify your code this way, file lightbox-
   slider.php, from line #113:
 *     ```
           $args = array(
               'label'               => __( 'Lightbox Slider', WEBLIZAR_LBS_TEXT_DOMAIN ),
               'description'         => __( 'Lightbox Slider', WEBLIZAR_LBS_TEXT_DOMAIN ),
               'labels'              => $labels,
               'supports'            => array( 'title', '', '', '', '', '', '', '', '', '', '', ),
               //'taxonomies'          => array( 'category', 'post_tag' ),
               'hierarchical'        => false,
               'public'              => false,
               'show_ui'             => true,
               'show_in_menu'        => true,
               'show_in_nav_menus'   => false,
               'show_in_admin_bar'   => false,
               'menu_position'       => 5,
               'menu_icon'           => 'dashicons-format-gallery',
               'can_export'          => true,
               'has_archive'         => true,
               'exclude_from_search' => false,
               'publicly_queryable'  => false,
               'capability_type'     => 'lightbox_slider',
               'map_meta_cap'        => true
           );
           $lb_post_type = register_post_type( 'lightbox-slider', $args );
   
           // add custom capabilities for lightbox-slider post type to the 'administrator' role
           global $wp_roles;
           $role = $wp_roles->role_objects['administrator'];
           foreach ($lb_post_type->cap as $cap) {
               if (!isset($role->capabilities[$cap])) {
                   $role->add_cap($cap);
               }
           }
       ```
   
 * Look at 2 last items of $args array. I changed capability_type from ‘page’ to‘
   lightbox_slider’ and added map_meta_cap argument with true value.
 * Then I add new capabilities from your post type to the ‘administrator’ role in
   order provide access to your post type to at least administrators as the 1st 
   step on plugin activation.
 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/#post-9363773)
 * If you will define “Settings” and other menu items with ‘manage_lightbox_slider’
   capability then you need to add this capability to ‘administrator’ role. Just
   add to the end of code about this line:
 *     ```
       $role->add_cap('manage_lightbox_slider');
       ```
   
    -  This reply was modified 8 years, 10 months ago by [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/).
 *  Thread Starter [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/#post-9365944)
 * I got all code, very well explained.
 * Do I modify only for a specific user?
 * Or
 * Do make this changes permanently for all user?
 * Thanks for so fast reply. 🙂
 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/#post-9366463)
 * You are welcome!
 * It will expand an area how users can use your plugin, if you include this changes
   to your next version. ‘administrator’ will still have full access to your plugin
   by default, but it will be possible to delegate a work with plugin to the users
   with lower privileges.
 * A specific user will not have to update your plugin code manually after every
   update of a main version.
 * Final decision is for you though.
 *  Thread Starter [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/#post-9366542)
 * Okay, that’s great.
 * Thanks so much for all help. User Role Editor such a great plugin.
 * I made a recommendation and review for you – [https://wordpress.org/support/topic/great-recommended-plugin-to-controll-users-usablilty/](https://wordpress.org/support/topic/great-recommended-plugin-to-controll-users-usablilty/)
 * Thanks
    Weblizar

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Make Compatible With Our Plugins’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/compatible-15/#post-9366542)
 * Status: resolved