From ebe702a85112f0c762df961b7ce22a29acbe7923 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Mon, 9 Nov 2009 22:15:50 +0000 Subject: [PATCH] Better documentation on the format of the capabilities when adding a role. Fixes #11106 props simonwheatley. git-svn-id: https://develop.svn.wordpress.org/trunk@12160 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/capabilities.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 1e963cb95c..110c9f2aac 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -123,12 +123,15 @@ class WP_Roles { * * Updates the list of roles, if the role doesn't already exist. * + * The capabilities are defined in the following format `array( 'read' => true );` + * To explicitly deny a role a capability you set the value for that capability to false. + * * @since 2.0.0 * @access public * * @param string $role Role name. * @param string $display_name Role display name. - * @param array $capabilities List of role capabilities. + * @param array $capabilities List of role capabilities in the above format. * @return null|WP_Role WP_Role object if role is added, null if already exists. */ function add_role( $role, $display_name, $capabilities = array() ) { @@ -174,7 +177,7 @@ class WP_Roles { * * @param string $role Role name. * @param string $cap Capability name. - * @param bool $grant Optional, default is true. Whether role is capable of preforming capability. + * @param bool $grant Optional, default is true. Whether role is capable of performing capability. */ function add_cap( $role, $cap, $grant = true ) { $this->roles[$role]['capabilities'][$cap] = $grant;