• A WP Life

    (@awordpresslife)


    Hi,

    We have a plugin portfolio gallery, we want to make compatible our plugin with your plugin.

    So how can we do?

    Please help us.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter A WP Life

    (@awordpresslife)

    Hi,

    WE are waiting for your reply.

    Please help us.

    Thanks

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    It’s compatible. You just use a ‘page’ capability type for your custom post type ‘awl_filter_gallery’. So you plugin users have to grant ‘pages’ capabilities to provide access to it. As ‘pages’ capabilities belong to another post type – WP built-in ‘pages’, URE shows ‘0’ to the right from you custom post type.

    You can define your CPT with its own capability type, like ‘awl_gallery’ instead of ‘page’. Then WP will use ‘edit_galleries’, ‘publish_galleries’, etc., look at ‘capability_type’ parameter description at this page for more details.

    You may need to add those custom capabilities at least to ‘administrator’ role then.

    Thread Starter A WP Life

    (@awordpresslife)

    Hi Vladimir,

    Thanks for the reply, that was too helpful.

    But we have a submenu page can’t make it capable.

    Please see below code, are we doing right?

    public function add_awpl_caps() {
      $read_filter_page_caps = array(
        'read' => true,
        'filter_submenu_page' => TRUE // this is important for your scope
      );
      add_role( 'filter', 'Fliter', $read_filter_page_caps );
      $roles = new WP_Roles();
      $roles->add_cap( 'subscriber', 'filter_submenu_page', TRUE);
    }

    Looking forward to your reply.

    Thanks

    Thread Starter A WP Life

    (@awordpresslife)

    We are waiting for reply

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    Code is correct. If you need to save your changes to the database, you have to add ‘use_db’ property change:

    
    $roles = new WP_Roles();
    $roles->use_db = true;
    $roles->add_cap( 'subscriber', 'filter_submenu_page', TRUE);
    
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘how to compatible’ is closed to new replies.