esc_html__( 'Shop', 'members' ), 'label_count' => _n_noop( 'Shop %s', 'Shop %s', 'members' ), 'roles' => $roles ] ); } } ); /** * Registers custom cap groups. * * @since 1.0.0 * @access public * @return void */ add_action( 'members_register_cap_groups', function() { // Only run if we have the `download` post type. if ( $type = get_post_type_object( 'download' ) ) { $groups = [ 'download', 'edd_payment', 'edd_discount' ]; // Unregister any cap groups already registered for the plugin's // custom post types. foreach ( $groups as $group ) { members_unregister_cap_group( "type-{$group}" ); } // Register a cap group for the EDD plugin. members_register_cap_group( 'plugin-edd',[ 'label' => esc_html__( 'Downloads', 'members' ), // EDD registers its menu icon as 'none' (it styles its own), so use a dashicon. 'icon' => $type->menu_icon && 'none' !== $type->menu_icon ? $type->menu_icon : 'dashicons-download', 'priority' => 11 ] ); } } ); /** * Registers the EDD plugin capabilities. * * @since 1.0.0 * @access public * @return void */ add_action( 'members_register_caps', function() { if ( class_exists( 'Easy_Digital_Downloads' ) ) { foreach ( edd_caps() as $name => $args ) { members_register_cap( $name, [ 'label' => $args['label'], 'description' => $args['description'], 'group' => 'plugin-edd' ] ); } } } );