Update WP and plugins
This commit is contained in:
parent
10a4713229
commit
1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions
|
@ -41,7 +41,7 @@ class WP_Role {
|
|||
* @param array $capabilities List of capabilities.
|
||||
*/
|
||||
public function __construct( $role, $capabilities ) {
|
||||
$this->name = $role;
|
||||
$this->name = $role;
|
||||
$this->capabilities = $capabilities;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ class WP_Role {
|
|||
* @param bool $grant Whether role has capability privilege.
|
||||
*/
|
||||
public function add_cap( $cap, $grant = true ) {
|
||||
$this->capabilities[$cap] = $grant;
|
||||
$this->capabilities[ $cap ] = $grant;
|
||||
wp_roles()->add_cap( $this->name, $cap, $grant );
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ class WP_Role {
|
|||
* @param string $cap Capability name.
|
||||
*/
|
||||
public function remove_cap( $cap ) {
|
||||
unset( $this->capabilities[$cap] );
|
||||
unset( $this->capabilities[ $cap ] );
|
||||
wp_roles()->remove_cap( $this->name, $cap );
|
||||
}
|
||||
|
||||
|
@ -94,16 +94,17 @@ class WP_Role {
|
|||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param array $capabilities Array of role capabilities.
|
||||
* @param bool[] $capabilities Associative array of capabilities for the role.
|
||||
* @param string $cap Capability name.
|
||||
* @param string $name Role name.
|
||||
*/
|
||||
$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
|
||||
|
||||
if ( !empty( $capabilities[$cap] ) )
|
||||
return $capabilities[$cap];
|
||||
else
|
||||
if ( ! empty( $capabilities[ $cap ] ) ) {
|
||||
return $capabilities[ $cap ];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue