This code used to work in 6.6.0, however, in adminKit 3.0, the introduction of namespacing borked the check against WP_Role, causing the capability to not get added to the administrator role. Users that had previously installed 6.6.0 did not see an issue due to WordPress caching capabilities assigned to a role.
This code used to work in 6.6.0, however, in adminKit 3.0, the introduction of namespacing borked the check against WP_Role, causing the capability to not get added to the administrator role. Users that had previously installed 6.6.0 did not see an issue due to WordPress caching capabilities assigned to a role.