WordPress.org

Make WordPress Core

Changeset 19325


Ignore:
Timestamp:
11/17/2011 08:40:24 PM (7 years ago)
Author:
duck_
Message:

Provide back compat mapping for user_level, wp_usersettings and wp_usersettingstime properties of WP_User objects. Fixes #19265.

File:
1 edited

Legend:

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

    r19171 r19325  
    421421    var $filter = null;
    422422
    423     private static $back_compat_keys = array(
    424         'user_firstname' => 'first_name',
    425         'user_lastname' => 'last_name',
    426         'user_description' => 'description'
    427     );
     423    private static $back_compat_keys;
    428424
    429425    /**
     
    441437     */
    442438    function __construct( $id = 0, $name = '', $blog_id = '' ) {
     439        if ( ! isset( self::$back_compat_keys ) ) {
     440            $prefix = $GLOBALS['wpdb']->prefix;
     441            self::$back_compat_keys = array(
     442                'user_firstname' => 'first_name',
     443                'user_lastname' => 'last_name',
     444                'user_description' => 'description',
     445                'user_level' => $prefix . 'user_level',
     446                $prefix . 'usersettings' => $prefix . 'user-settings',
     447                $prefix . 'usersettingstime' => $prefix . 'user-settings-time',
     448            );
     449        }
     450
    443451        if ( ! empty( $id ) && ! is_numeric( $id ) ) {
    444452            $name = $id;
Note: See TracChangeset for help on using the changeset viewer.