add_cap( self::CAP ); } /** * Remove the approval capability from every registered role. * * Called only from uninstall.php. */ public static function remove_from_all_roles(): void { foreach ( array_keys( wp_roles()->roles ) as $role_slug ) { $role = get_role( (string) $role_slug ); if ( null === $role ) { continue; } $role->remove_cap( self::CAP ); } } }