Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to enable profile & edit profile normal Subscribers/Participants?


  • jwarren
    Participant

    @jwarren

    So, I’ve added bbpress to quite a big WordPress site. While everything works fine and dandy for the admins, most (if not all) regular users aren’t able to view their profile page or edit their profile. I’ve changed all regular users to the “Participant” role, but it still simply returns a 404. Which capabilities do I need to add to the Participant to enable the profile?

    Additionally, I’m generating the edit profile link like so:

    `/forums/users/<?php wp_get_current_user()->user_login ?>

    However, this feels a bit hacky and fragile – is there a better way?

    WP 3.8, bbPress 2.5.1

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

  • ronthai
    Participant

    @ronthai

    http://bbpress.org/forums/topic/menu-link-to-profile/#post-139989

    <?php global $current_user;
          get_currentuserinfo();
         echo  $current_user->user_login . "";      
    ?>

    jwarren
    Participant

    @jwarren

    Thanks @ronthai, but that’s kind of the same thing I’m doing. If you check the source, you’ll see wp_get_current_user() basically abstracts the same thing. Did check out your linked post though, neat idea.

    Any idea on the edit profile capabilities? It’s really kicking my arse.


    ronthai
    Participant

    @ronthai

    I thought it might had to do with your linked php part, but have not tried it.

    If they are participant, edit profile should work, no idea why you get a 404

    EDIT:
    Just tried your php code in a link and does not work for me


    jwarren
    Participant

    @jwarren

    Thanks for giving it a shot. Sorry, the code wasn’t a straight copy and paste and I slightly borked it in the post.

    It’s basically:

    <?php $this_user = wp_get_current_user(); ?>
    <a href="/forums/users/<?php echo $this_user->user_login; ?>/edit/">Edit Forum profile</a>
    

    You’ll find that this should generate the same URL as you’ve done.


    jwarren
    Participant

    @jwarren

    Okay, sorted!

    I took a dive into bbPress source code, and ‘bb_get_user_profile_url()’ is the correct function to use to get to a user’s profile. Here’s the source link

    And an example usage:

    <?php $this_user = wp_get_current_user(); ?>
    <a href="<?php echo bbp_get_user_profile_url($this_user->ID); ?>edit/">Edit Forum profile</a>
    

    jwarren
    Participant

    @jwarren

    Sorry, that should be: bbp_get_user_profile_url()


    Stephen Edgar
    Moderator

    @netweb

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

You must be logged in to reply to this topic.