Make WordPress Core


Ignore:
Timestamp:
02/22/2010 09:25:32 PM (17 years ago)
Author:
nacin
Message:

Don't use deprecated *_usermeta() functions. Props technosailor fixes #10837

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r13270 r13311  
    568568        function add_role( $role ) {
    569569                $this->caps[$role] = true;
    570                 update_usermeta( $this->ID, $this->cap_key, $this->caps );
     570                update_user_meta( $this->ID, $this->cap_key, $this->caps );
    571571                $this->get_role_caps();
    572572                $this->update_user_level_from_caps();
     
    585585                        return;
    586586                unset( $this->caps[$role] );
    587                 update_usermeta( $this->ID, $this->cap_key, $this->caps );
     587                update_user_meta( $this->ID, $this->cap_key, $this->caps );
    588588                $this->get_role_caps();
    589589        }
     
    610610                        $this->roles = false;
    611611                }
    612                 update_usermeta( $this->ID, $this->cap_key, $this->caps );
     612                update_user_meta( $this->ID, $this->cap_key, $this->caps );
    613613                $this->get_role_caps();
    614614                $this->update_user_level_from_caps();
     
    657657                global $wpdb;
    658658                $this->user_level = array_reduce( array_keys( $this->allcaps ), array( &$this, 'level_reduction' ), 0 );
    659                 update_usermeta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level );
     659                update_user_meta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level );
    660660        }
    661661
     
    671671        function add_cap( $cap, $grant = true ) {
    672672                $this->caps[$cap] = $grant;
    673                 update_usermeta( $this->ID, $this->cap_key, $this->caps );
     673                update_user_meta( $this->ID, $this->cap_key, $this->caps );
    674674        }
    675675
     
    686686                        return;
    687687                unset( $this->caps[$cap] );
    688                 update_usermeta( $this->ID, $this->cap_key, $this->caps );
     688                update_user_meta( $this->ID, $this->cap_key, $this->caps );
    689689        }
    690690
     
    698698                global $wpdb;
    699699                $this->caps = array();
    700                 update_usermeta( $this->ID, $this->cap_key, '' );
    701                 update_usermeta( $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', '' );
    702702                $this->get_role_caps();
    703703        }
Note: See TracChangeset for help on using the changeset viewer.