• pschoefer

    (@pschoefer)


    Hi there,

    I was wondering how I can get my custom taxonomy capabilities to show within the custom post type group in the left sidebar. At the moment, the only way to find them is to search when “all capabilities” is selected on the left.

    Is URE trying to organize those for me or is it my responsibility to organize custom capabilities in the proper sidebar group?

    Thank you
    Philipp

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    Some groups are hard-coded in URE. URE tries to create groups for custom post types automatically.
    It’s possible to add custom groups via filters. Look at includes/classes/capabilties-groups-manager.php:
    ure_capabilities_groups_tree – allows to add your own group to the groups tree;
    ure_custom_capability_groups – allows to add custom capability to the groups.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    This is an example how to use these filters to show Gravity Forms plugin capabilities in a separate group under “Custom capabilities” section:

    
    add_filter('ure_capabilities_groups_tree', 'ure_add_gf_group_to_tree', 10, 1);
    
    function ure_add_gf_group_to_tree($groups) {
        $groups['gravityforms'] = array('caption'=>'Gravity Forms', 'parent'=>'custom', 'level'=>2);
        
        return $groups;
    }
    
    add_filter('ure_custom_capability_groups', 'ure_group_gf_caps', 10, 2);
    
    function ure_group_gf_caps($groups, $cap_id) {
        
        if (strpos($cap_id, 'gravityforms')===0) {
            $groups[] = 'gravityforms';
        }
        
        return $groups;    
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Put custom capability into group’ is closed to new replies.