Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP-FBConnect Login Button (and Logout, too)

  • Avatar of grahamlindsey
    grahamlindsey
    Member

    @grahamlindsey

    Hi all,

    I’ve installed BP-FBConnect and it plays very nicely with my BP installation. The only question I have is about integrating it with the BP menu bar:

    Is there an elegant way to make the “Logout of Site & Facebook” link and the BP My Account > Log Out (through the BP menubar) buttons have the same functionality? The catch is, some users won’t login using their Facebook accounts, so I can’t just hard code the change on the Log Out menu item.

    BP-FBConnect function is this:
    Logout of Site & Facebook

    BP Function is:
    Log Out

    I can’t logout using BP if I’ve logged in with BP-FBC, and when I hit the usual “Login” button, it brings up the standard WP login screen. Ideally I want to inject the code for the BP-FBC into that page (which I’m doing) and tie-in the Logoff / Log Out functionality of both WP and BP-FBC.

    WP 3.0.5 (not 3.1 until BP will work in that environment)
    BP 1.2.7
    WP-FBC 1.2

    Thanks for any help you can lend,
    Graham

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of grahamlindsey
    grahamlindsey
    Member

    @grahamlindsey

    Apologies – missed putting the code in backticks:

    BP-FBConnect function is this:
    `Logout of Site & Facebook`

    BP Function is:
    `Log Out`

    Avatar of ORyanMcentire
    ORyanMcentire
    Member

    @oryanmcentire

    What happens if you try adding that onclick action to your BP log out?

    `Log Out`

    Avatar of Dj Kad
    Dj Kad
    Participant

    @dj-kad

    I made this: Add this code at the end of functions.php file included in your theme.
    It adds “Login – Register” or “Logout” buttons to your nav menu:
    `
    add_filter(‘wp_nav_menu_items’,’add_login_buttons’);
    function add_login_buttons ($nav){
    if ( is_user_logged_in() ) {
    return $nav.”

  • Exit
  • “;
    }
    else {
    return $nav.”

  • Login
  • Sign Up
  • “;
    }
    }
    `

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.