Changeset 13311 for trunk/wp-includes/capabilities.php
- Timestamp:
- 02/22/2010 09:25:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r13270 r13311 568 568 function add_role( $role ) { 569 569 $this->caps[$role] = true; 570 update_user meta( $this->ID, $this->cap_key, $this->caps );570 update_user_meta( $this->ID, $this->cap_key, $this->caps ); 571 571 $this->get_role_caps(); 572 572 $this->update_user_level_from_caps(); … … 585 585 return; 586 586 unset( $this->caps[$role] ); 587 update_user meta( $this->ID, $this->cap_key, $this->caps );587 update_user_meta( $this->ID, $this->cap_key, $this->caps ); 588 588 $this->get_role_caps(); 589 589 } … … 610 610 $this->roles = false; 611 611 } 612 update_user meta( $this->ID, $this->cap_key, $this->caps );612 update_user_meta( $this->ID, $this->cap_key, $this->caps ); 613 613 $this->get_role_caps(); 614 614 $this->update_user_level_from_caps(); … … 657 657 global $wpdb; 658 658 $this->user_level = array_reduce( array_keys( $this->allcaps ), array( &$this, 'level_reduction' ), 0 ); 659 update_user meta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level );659 update_user_meta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level ); 660 660 } 661 661 … … 671 671 function add_cap( $cap, $grant = true ) { 672 672 $this->caps[$cap] = $grant; 673 update_user meta( $this->ID, $this->cap_key, $this->caps );673 update_user_meta( $this->ID, $this->cap_key, $this->caps ); 674 674 } 675 675 … … 686 686 return; 687 687 unset( $this->caps[$cap] ); 688 update_user meta( $this->ID, $this->cap_key, $this->caps );688 update_user_meta( $this->ID, $this->cap_key, $this->caps ); 689 689 } 690 690 … … 698 698 global $wpdb; 699 699 $this->caps = array(); 700 update_user meta( $this->ID, $this->cap_key, '' );701 update_user meta( $this->ID, $wpdb->prefix . 'user_level', '' );700 update_user_meta( $this->ID, $this->cap_key, '' ); 701 update_user_meta( $this->ID, $wpdb->prefix . 'user_level', '' ); 702 702 $this->get_role_caps(); 703 703 }
Note: See TracChangeset
for help on using the changeset viewer.