#28451 closed defect (bug) (invalid)
current_user_can() not working properly in a network
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.9.1 |
| Component: | Role/Capability | Keywords: | |
| Focuses: | Cc: |
Description
In a WP network installation the current_user_can() function returns false even if the current user actually has the capability.
eg.
printing the $current_user global variable shows:
WP_User Object
(
....
[allcaps] => Array
(
[read] => 1
[publish_posts] => 1
[edit_posts] => 1
[delete_posts] => 1
[edit_published_posts] => 1
[delete_published_posts] => 1
[upload_files] => 1
[unfiltered_html] => 1
[level_0] => 1
[level_1] => 1
[level_2] => 1
[author] => 1
)
)
Which shows that the user has the 'unfiltered_html' capability, but current_user_can('unfiltered_html') returns false.
If it is useful, I am running this inside a 'mce_buttons' filter. The $current_user global is properly populated as shown above.
Works fine on a single-site installation.
Change History (3)
Note: See
TracTickets for help on using
tickets.
This is by design: only super-admins can use unfiltered html on MS setups.