Changeset 48574 for trunk/src/wp-includes/class-wp-role.php
- Timestamp:
- 07/23/2020 12:50:57 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-role.php
r46596 r48574 26 26 * 27 27 * @since 2.0.0 28 * @var array 28 * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values 29 * represent whether the role has that capability. 29 30 */ 30 31 public $capabilities; … … 33 34 * Constructor - Set up object properties. 34 35 * 35 * The list of capabilities ,must have the key as the name of the capability36 * The list of capabilities must have the key as the name of the capability 36 37 * and the value a boolean of whether it is granted to the role. 37 38 * … … 39 40 * 40 41 * @param string $role Role name. 41 * @param bool[] $capabilities List of capabilities keyed by the capability name,42 * e.g. array( 'edit_posts' => true, 'delete_posts' => false ).42 * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values 43 * represent whether the role has that capability. 43 44 */ 44 45 public function __construct( $role, $capabilities ) { … … 52 53 * @since 2.0.0 53 54 * 54 * @param string $cap Capability name.55 * @param bool $grant Whether role has capability privilege.55 * @param string $cap Capability name. 56 * @param bool $grant Whether role has capability privilege. 56 57 */ 57 58 public function add_cap( $cap, $grant = true ) { … … 62 63 /** 63 64 * Removes a capability from a role. 64 *65 * This is a container for WP_Roles::remove_cap() to remove the66 * capability from the role. That is to say, that WP_Roles::remove_cap()67 * implements the functionality, but it also makes sense to use this class,68 * because you don't need to enter the role name.69 65 * 70 66 * @since 2.0.0 … … 80 76 * Determines whether the role has the given capability. 81 77 * 82 * The capabilities is passed through the {@see 'role_has_cap'} filter.83 * The first parameter for the hook is the list of capabilities the class84 * has assigned. The second parameter is the capability name to look for.85 * The third and final parameter for the hook is the role name.86 *87 78 * @since 2.0.0 88 79 * 89 80 * @param string $cap Capability name. 90 * @return bool True if the role has the given capability. False otherwise.81 * @return bool Whether the role has the given capability. 91 82 */ 92 83 public function has_cap( $cap ) { … … 96 87 * @since 2.0.0 97 88 * 98 * @param bool[] $capabilities Associative array of capabilities for the role. 89 * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values 90 * represent whether the role has that capability. 99 91 * @param string $cap Capability name. 100 92 * @param string $name Role name.
Note: See TracChangeset
for help on using the changeset viewer.