Opened 11 years ago
Closed 11 years ago
#4975 closed enhancement (fixed)
Add $user_nicename to bp_core_get_userid_from_nicename filter
Reported by: | megainfo | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.8 | Priority: | low |
Severity: | minor | Version: | 1.7 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
For more compatibility, i suggest add $user_nicename to the filter
Actual Code of function bp_core_get_userid_from_nicename
function bp_core_get_userid_from_nicename( $user_nicename ) { global $wpdb; if ( empty( $user_nicename ) ) return false; return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->users} WHERE user_nicename = %s", $user_nicename ) ) ); }
To,
function bp_core_get_userid_from_nicename( $user_nicename ) { global $wpdb; if ( empty( $user_nicename ) ) return false; return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->users} WHERE user_nicename = %s", $user_nicename ) ), $user_nicename ); }
Change History (2)
Note: See
TracTickets for help on using
tickets.
Easy, and valid, and this function also needs caching. :)
Putting into 1.8.