WordPress.org

Make WordPress Core

Ticket #33869: 33869.diff

File 33869.diff, 897 bytes (added by Shelob9, 6 years ago)
  • wp-includes/class-wp-user.php

    wp-includes/class-wp-user.php | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/wp-includes/class-wp-user.php b/wp-includes/class-wp-user.php
    index 971021a..ffa68de 100644
    a b public function init( $data, $blog_id = '' ) { 
    170170   *
    171171   * @global wpdb $wpdb
    172172   *
    173          * @param string $field The field to query against: 'id', 'slug', 'email' or 'login'
     173         * @param string $field The field to query against: 'id', 'ID', 'slug', 'email' or 'login'
    174174   * @param string|int $value The field value
    175175   * @return object|false Raw user object
    176176   */
    177177  public static function get_data_by( $field, $value ) {
    178178      global $wpdb;
     179
     180                if ( 'ID' == $field ) {
     181                        $field = 'id';
     182                }
    179183
    180184      if ( 'id' == $field ) {
    181185          // Make sure the value is numeric to avoid casting objects, for example,