Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/15/2014 08:07:22 PM (12 years ago)
Author:
r-a-y
Message:

Use get_user_by() for bp_core_get_userid_from_nicename() and bp_core_get_userid()

Previously, these functions used direct DB queries to grab the user ID when
a user_nicename or user_login was passed.

This commit switches these direct DB queries to use get_user_by(), which
caches the query when a persistent object cache is enabled.

Fixes #5696.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/functions.php

    r8333 r8532  
    400400        $this->assertSame( $expected, $found );
    401401    }
     402
     403    /**
     404     * @group bp_core_get_userid_from_nicename
     405     */
     406    public function test_bp_core_get_userid_from_nicename_failure() {
     407        $this->assertSame( NULL, bp_core_get_userid_from_nicename( 'non_existent_user' ) );
     408    }
    402409}
Note: See TracChangeset for help on using the changeset viewer.