Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Tim2376
    Participant

    @tim2376

    Alright, I figured it out. Here is the code that works…

    add_action( 'xprofile_updated_profile', 'SaveEditsRedirect', 12 );
    function SaveEditsRedirect() {
    global $bp;
    wp_redirect( $bp->loggedin_user->domain );
    exit;
    }

    Tim2376
    Participant

    @tim2376

    Thanks guys!

    At first I was thinking about having each extended profile item on a new tab. However, now that I have looked at what you were saying about just being able to edit the profile items form the profile tab, I think that might be the best option. Since I was new, I was referring to the user’s page as the profile page instead of the “profile” tab.

    I have so many extended profile tabs that it looks better on the profile tab then adding tabs for each one.


    @ubernaut
    Thanks for the invite! I took the survey the other day, but I was unable to attend the online meeting. Sounds fun though… I am looking forward to coming sometime.


    Tim2376
    Participant

    @tim2376

    Yes, I know you can edit all the field from the back end. However, I am trying to get it to allow you to show and edit the fields from the front end. Here were the steps I am thinking about using:

    1) Use BuddyPress Custom Profile Menu plugin to create new tabs on the profile page like, “about”
    2) make a function in function.php of my theme that would display the content for a user and allow them to edit it if it was their profile.
    3) create a shortcode function that linked to the function in step 2.
    4) Add the shortcode in the new page created with BuddyPress Custom Profile Menu plugin in step 1.

    I know how to do step 1, 3, and 4. I have an idea of how to do step 2, but I am a little fuzzy on it. Here is what I was thinking(I don’t really know php):

    function ProfileAboutPageContent(){
        if(bp_loggedin_user_id() == $GLOBALS['bp']->displayed_user->userdata->user_login)
        {
        echo "<p>'"bp_profile_field_data( 'field=User Bio' )"'</p>";
        //Allow user to edit the content(not sure how)
        } elseif {
        echo "<p>'"bp_profile_field_data( 'field=User Bio' )"'</p>";
        {
    }
    add_shortcode('AboutContent', 'ProfileAboutPageContent');

    Are there any errors in this code? I am not sure how to allow users to edit the content if they are the right user. Any ideas on how I could change this code? I am planning on putting this code in the function.php of my current theme.

    The idea is that after I get this function and short code right I can add the shortcode to the new page I can create with the BuddyPress Custom Profile Menu plugin.

    If anyone would be willing to help me figure this out I would greatly appreciate it. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar