Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add Friend Button and WPNONCE problems


  • linkedbinary900
    Participant

    @linkedbinary900

    Hello, I am currently running WP 4.0 and the latest version of BuddyPress as well. When I attempt to add a friend, I am running into the “Are you sure you want to do this?” message, and when I try to continue, it seems my friend request gets thrown out and I am redirected to the user’s page.

    Please help, I am deep into this project and my client will not like that their customers cannot add any friends 🙁

    -Zacharius

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

  • Henry Wright
    Moderator

    @henrywright

    Hi @linkedbinary900

    What’s your button markup?


    linkedbinary900
    Participant

    @linkedbinary900

    the link is like this (I’ve hidden the main part of the URL, as the site is not yet Public)…

    /members/(username)/friends/add-friend/8/?_wpnonce=846748ee21

    Sorry if that’s not what you were looking for @henrywright


    Henry Wright
    Moderator

    @henrywright

    I can see you’re passing the wpnonce via ?_wpnonce=846748ee21 but how are you generating it and how are you verifying it?


    linkedbinary900
    Participant

    @linkedbinary900

    I’m really not sure if a plugin has mandated the _wpnonce string or what the deal is… Is it something that BuddyPress adds for security? I have seen it on other links, and works fine for different functions like send public message, etc where the _wpnonce is also used.

    Note: I am only experiencing my problem with not being able to add a friend from a user’s member page. It works fine on the Members List page.


    Henry Wright
    Moderator

    @henrywright

    Try using bp_add_friend_button() to generate the button’s markup. That should create a valid wpnonce for you.


    linkedbinary900
    Participant

    @linkedbinary900

    Where would I add that? I have not enabled a custom BuddyPress theme or anything…


    Henry Wright
    Moderator

    @henrywright

    You would add it to your template for the single member page.

    Take a look at the Template Hierarchy article for more info on setting up your BP templates.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add Friend Button and WPNONCE problems’ is closed to new replies.
Skip to toolbar