Changeset 12479 for trunk/wp-includes/capabilities.php
- Timestamp:
- 12/22/2009 11:42:46 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r12332 r12479 98 98 */ 99 99 function _init () { 100 global $wpdb; 101 global $wp_user_roles; 100 global $wpdb, $wp_user_roles; 102 101 $this->role_key = $wpdb->prefix . 'user_roles'; 103 102 if ( ! empty( $wp_user_roles ) ) { … … 546 545 $this->allcaps = array(); 547 546 foreach ( (array) $this->roles as $role ) { 548 $ role =& $wp_roles->get_role( $role );549 $this->allcaps = array_merge( (array) $this->allcaps, (array) $ role->capabilities );547 $the_role =& $wp_roles->get_role( $role ); 548 $this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities ); 550 549 } 551 550 $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); … … 653 652 global $wpdb; 654 653 $this->user_level = array_reduce( array_keys( $this->allcaps ), array( &$this, 'level_reduction' ), 0 ); 655 update_usermeta( $this->ID, $wpdb->prefix .'user_level', $this->user_level );654 update_usermeta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level ); 656 655 } 657 656 … … 679 678 */ 680 679 function remove_cap( $cap ) { 681 if ( empty( $this->caps[$cap] ) ) return; 680 if ( empty( $this->caps[$cap] ) ) 681 return; 682 682 unset( $this->caps[$cap] ); 683 683 update_usermeta( $this->ID, $this->cap_key, $this->caps ); … … 694 694 $this->caps = array(); 695 695 update_usermeta( $this->ID, $this->cap_key, '' ); 696 update_usermeta( $this->ID, $wpdb->prefix .'user_level', '' );696 update_usermeta( $this->ID, $wpdb->prefix . 'user_level', '' ); 697 697 $this->get_role_caps(); 698 698 } … … 783 783 } 784 784 785 if ( '' != $post->post_author) {785 if ( '' != $post->post_author ) { 786 786 $post_author_data = get_userdata( $post->post_author ); 787 787 } else {
Note: See TracChangeset
for help on using the changeset viewer.