Uses
| Uses | Description |
|---|---|
| wp-includes/user.php: update_user_meta() | Update user meta field based on user ID. |
| wp-includes/wp-db.php: wpdb::get_blog_prefix() | Gets blog prefix. |
Update the maximum user level for the user.
Updates the ‘user_level’ user metadata (includes prefix that is the database table prefix) with the maximum user level. Gets the value from the all of the capabilities that the user has.
File: wp-includes/class-wp-user.php
public function update_user_level_from_caps() {
global $wpdb;
$this->user_level = array_reduce( array_keys( $this->allcaps ), array( $this, 'level_reduction' ), 0 );
update_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level', $this->user_level );
} | Version | Description |
|---|---|
| 2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_user/update_user_level_from_caps