Skip to content

Commit f64263a

Browse files
authored
Create wp_bbp_users_roles.sql
1 parent 65a829b commit f64263a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* Insert all users roles, bbPress allows single role per user */
2+
INSERT INTO wp_bbp_users_roles
3+
SELECT DISTINCT user_id,
4+
(CASE
5+
WHEN LOCATE('bbp_keymaster', meta_value) > 0 THEN 'bbp_keymaster'
6+
WHEN LOCATE('bbp_moderator', meta_value) > 0 THEN 'bbp_moderator'
7+
WHEN LOCATE('bbp_participant', meta_value) > 0 THEN 'bbp_participant'
8+
WHEN LOCATE('bbp_spectator', meta_value) > 0 THEN 'bbp_spectator'
9+
WHEN LOCATE('bbp_blocked', meta_value) > 0 THEN 'bbp_blocked'
10+
WHEN LOCATE('bbp_spammer', meta_value) > 0 THEN 'bbp_spammer'
11+
ELSE 'bbp_spectator'
12+
END) AS role
13+
FROM wp_usermeta WHERE meta_key = 'wp_capabilities'

0 commit comments

Comments
 (0)