WordPress.org

Ready to get started?Download WordPress

Forums

Add Link to Facebook
[resolved] Found a bug in multisite login processing (2 posts)

  1. Peidong Hu
    Member
    Posted 1 year ago #

    In function static function Facebook_login(), the code will validate if the facebook user has already registered on wordpress by running this query,
    $users = get_users(array(
    'meta_key' => c_al2fb_meta_facebook_id,
    'meta_value' => $me->id
    ));
    But in wordpress 3.3 and above version, 'meta_key' is prefixed with "blog_'blog_id'_" in usermeta table. So before running above query, c_al2fb_meta_facebook_id need to be prefixed with correct blog id.

    add following code before this query to fix it,

    //phu fix bug of multisite wrong meta facebook id
    $c_al2fb_meta_facebook_id = c_al2fb_meta_facebook_id;

    if (is_multisite()) {
    global $blog_id;
    $c_al2fb_meta_facebook_id = "blog_".$blog_id."_".$c_al2fb_meta_facebook_id;
    }
    And then use the variable $c_al2fb_meta_facebook_id to replace the constant c_al2fb_meta_facebook_id in the following queries.

    Peidong

    http://wordpress.org/extend/plugins/add-link-to-facebook/

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for this fix, it will be in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.