Make WordPress Core


Ignore:
Timestamp:
11/09/2009 10:15:50 PM (17 years ago)
Author:
westi
Message:

Better documentation on the format of the capabilities when adding a role. Fixes #11106 props simonwheatley.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r12053 r12160  
    124124         * Updates the list of roles, if the role doesn't already exist.
    125125         *
     126         * The capabilities are defined in the following format `array( 'read' => true );`
     127         * To explicitly deny a role a capability you set the value for that capability to false.
     128         *
    126129         * @since 2.0.0
    127130         * @access public
    … …  
    129132         * @param string $role Role name.
    130133         * @param string $display_name Role display name.
    131          * @param array $capabilities List of role capabilities.
     134         * @param array $capabilities List of role capabilities in the above format.
    132135         * @return null|WP_Role WP_Role object if role is added, null if already exists.
    133136         */
    … …  
    175178         * @param string $role Role name.
    176179         * @param string $cap Capability name.
    177          * @param bool $grant Optional, default is true. Whether role is capable of preforming capability.
     180         * @param bool $grant Optional, default is true. Whether role is capable of performing capability.
    178181         */
    179182        function add_cap( $role, $cap, $grant = true ) {
Note: See TracChangeset for help on using the changeset viewer.