Changeset 54673 for trunk/src/wp-includes/capabilities.php
- Timestamp:
- 10/24/2022 02:54:08 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities.php
r54332 r54673 1032 1032 1033 1033 /** 1034 * Updates an existing role. Creates a new role if it doesn't exist.1035 *1036 * Modifies the display name and/or capabilities for an existing role.1037 * If the role does not exist then a new role is created.1038 *1039 * The capabilities are defined in the following format: `array( 'read' => true )`.1040 * To explicitly deny the role a capability, set the value for that capability to false.1041 *1042 * @since 6.1.01043 *1044 * @param string $role Role name.1045 * @param string|null $display_name Optional. Role display name. If null, the display name1046 * is not modified. Default null.1047 * @param bool[]|null $capabilities Optional. List of capabilities keyed by the capability name,1048 * e.g. `array( 'edit_posts' => true, 'delete_posts' => false )`.1049 * If null, don't alter capabilities for the existing role and make1050 * empty capabilities for the new one. Default null.1051 * @return WP_Role|void WP_Role object, if the role is updated.1052 */1053 function update_role( $role, $display_name = null, $capabilities = null ) {1054 return wp_roles()->update_role( $role, $display_name, $capabilities );1055 }1056 1057 /**1058 1034 * Removes a role, if it exists. 1059 1035 *
Note: See TracChangeset
for help on using the changeset viewer.