Changes between Initial Version and Version 1 of Ticket #43421, comment 2
- Timestamp:
- 03/10/2018 05:39:57 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #43421, comment 2
initial v1 12 12 }}} 13 13 14 and the Codex examples show this, too: https://codex.wordpress.org/Function_Reference/add_role#Example 15 14 16 You have to pass both these things. When you pass `$userCaps = [ 'read', 'my_cap', ];` you are effectively passing in the following array: `[ 0 => 'read', 1 => 'my_cap' ]`, which in turn tries to perform two calls: `add_cap( 0, 'read' )` and `add_cap( 1, 'my_cap' )`, which is, indeed, incompatible with what you're trying to achieve. 15 17