Commit 3844a0a
Revoke synced capabilities when their backing option is deleted
register() only hooked add_option/update_option, so deleting the
option (e.g. Pro's uninstall routine, gated behind the "delete data"
preference) left every role that had been granted the bundle stuck
with it indefinitely - the old array_intersect()-against-get_option()
check re-read the option live on every request, so this is a real
behavior change from before: deleting the option used to revoke
access instantly for everyone but admins, and now it wouldn't at all.
Hooking delete_option_{$option_name} to sync([]) closes that gap.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent c96102f commit 3844a0a
2 files changed
Lines changed: 36 additions & 0 deletions
File tree
- includes/classes/Capabilities
- tests/phpunit/includes/classes/Capabilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
102 | 126 | | |
103 | 127 | | |
104 | 128 | | |
| |||
0 commit comments