Changeset 54213 for trunk/src/wp-includes/capabilities.php
- Timestamp:
- 09/19/2022 08:47:22 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities.php
r53436 r54213 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.0 1043 * 1044 * @param string $role Role name. 1045 * @param string|null $display_name Optional. Role display name. If null, the display name 1046 * 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 make 1050 * 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 /** 1034 1058 * Removes a role, if it exists. 1035 1059 *
Note: See TracChangeset
for help on using the changeset viewer.