• Resolved sira162

    (@sira162)


    Hi.

    I am working with the Members Plugin so that it gets possible to enable capabilities to roles like for example show_post, edit_post, etc.

    I am searching for a way to get all the capabilities that roles could possibly get in wordpress and enable them all for my admin role. They are listed in the admin area when you go to Users > Roles > (any role) > +All

    My custom post types aren’t shown when I load my theme + plugin because they are denied by default.

    Thanks for any help.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The following is from the plugin’s Role_Edit class. You should be able to adapt it to your needs.

    		// Get all the capabilities.
    		$this->capabilities = members_get_capabilities();
    
    		// Add all caps from the cap groups.
    		foreach ( members_get_cap_groups() as $group )
    			$this->capabilities = array_merge( $this->capabilities, $group->caps );
    
    		// Make sure we have a unique array of caps.
    		$this->capabilities = array_unique( $this->capabilities );
Viewing 1 replies (of 1 total)
  • The topic ‘Get all possible Capabilities’ is closed to new replies.