- $promotions = array_diff( array_filter( self::$permitRoles, array( $this, 'hasOption' ) ), $inGroups );
+ $groups = array_filter( self::$permitRoles, array( $this, 'hasOption' ) );
+ if ( $this->hasOption( 'custom-groups' ) ) {
+ $customGroupsText = $this->getOption( 'custom-groups' );
+ if ( $customGroupsText !== '' ) {
+ $customGroups = explode( ',', $customGroupsText );
+ foreach ( $customGroups as $customGroup ) {
+ $groups[] = trim( $customGroup );
+ }
+ }
+ }
+
+ $promotions = array_diff(
+ $groups,
+ $inGroups
+ );