diff --git wp-includes/class-wp-user.php wp-includes/class-wp-user.php
index 210919d..d0069c2 100644
|
|
class WP_User { |
482 | 482 | if ( is_array( $this->caps ) ) |
483 | 483 | $this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) ); |
484 | 484 | |
485 | | //Build $allcaps from role caps, overlay user's $caps |
| 485 | /** |
| 486 | * Build $allcaps from role caps, overlaying user's $caps and caps from |
| 487 | * the user's roles. Role capabilities are filtered to only return caps |
| 488 | * which are true. This prevents false caps overwriting true caps. |
| 489 | */ |
486 | 490 | $this->allcaps = array(); |
487 | 491 | foreach ( (array) $this->roles as $role ) { |
488 | 492 | $the_role = $wp_roles->get_role( $role ); |
489 | | $this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities ); |
| 493 | $this->allcaps = array_merge( (array) $this->allcaps, array_filter( (array) $the_role->capabilities ) ); |
490 | 494 | } |
491 | 495 | $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); |
492 | 496 | |