Skip to:
Content

BuddyPress.org

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's profile megainfo Owned by: boonebgorges's profile 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)

#1 @johnjamesjacoby
11 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 1.8
  • Priority changed from normal to low
  • Severity changed from normal to minor

Easy, and valid, and this function also needs caching. :)

Putting into 1.8.

#2 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7119:

Pass $user_nicename to bp_core_get_userid_from_nicename filter

Fixes #4975

Props megainfo

Note: See TracTickets for help on using tickets.