• How to get logged-in user location in buddypress, You give by on click in form to get current location of user, But we need user already updated their location in profile that location we need so how can we get that location.
    Example :
    get_user_location($user_id);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Gnanasekaran Loganathan

    (@gnanasekaran)

    global $bp, $wpdb;

    $the_user_id = $bp->loggedin_user->userdata->ID;

    $results = $wpdb->get_results( “select * FROM wppl_friends_locator WHERE member_id = $the_user_id”, OBJECT );

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello Gnanasekaran,
    I apologize for the delayed reply.

    The script you use would be the best way to retrieve the the user’s location. You should probably look into adding prepare to the script for security purposes.

    Kind regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get logged-in user location in buddypress’ is closed to new replies.