Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • DanielEngelhardt
    Participant

    @danielengelhardt

    In case someone else wants to send users straight to the edit-page when clicking on “profile”-link, i got to manage it this way:
    (THIS HAS TO BE DONE IN wp-content/plugins/bp-custom.php, NOT IN YOUR CHILD THEMES functions.php)

    function my_change_profile_default_subnav() {
      global $bp;
      if (bp_is_my_profile()) {
        bp_core_new_nav_default(array( 'parent_slug' => $bp->profile->slug, 'screen_function' => "xprofile_screen_edit_profile", 'subnav_slug' => $bp->profile->edit->slug));
      }
    }
    add_action( 'bp_setup_nav', 'my_change_profile_default_subnav' );

    What helped me a lot was to temporarily put this snippet into my functions.php:

    function bp_dump() {
        global $bp;
     
        foreach ( $bp as $key => $value ) {
            echo '<pre>';
            echo '<strong>;' . $key . ': </strong><br />';
            print_r( $value );
            echo '</pre>';
        }
        die;
    }
    add_action( 'wp', 'bp_dump' );

    It gives you all the slugs, screen-functions, css-ids and all that good-to-know-stuff.

    Hope this helps 😉


    DanielEngelhardt
    Participant

    @danielengelhardt

    i did it that way and it worked for me. so i now have all my profile fields in one group and display only one of the fields on the registration-page


    DanielEngelhardt
    Participant

    @danielengelhardt

    hm, yes looks good. i will try that later.
    thanks @shanebp and @danbp for your inputs


    DanielEngelhardt
    Participant

    @danielengelhardt

    thanks for your input, @danbp.
    There is, of course, a reason why i want it as requested 🙂
    On my registration form, i only want to show one field to not bother new users with unnecessary fields. this one field is in my base group.
    All other fields are arranged in another group.

    From my point of view, it doesn’t make sense to show two tabs on the profile-edit page, but it does make sense to show as less fields as possible on the registration page. I think UX comes first today. Customers pay our rent, so we should avoid putting spokes in there wheel. I also think buddypress is doing a pretty bad job here regarding UX (Of course this behavior gives structure, but we pay with UX for it). Since we live in 2015 it shouldn’t be a matter of “hacking” to reduce the amount of inputs and clicks for such “trivial” actions (from a users perspective) like editing a profile.

    Is that reason enough? 🙂


    DanielEngelhardt
    Participant

    @danielengelhardt

    @brettlewis, did you get to manage it? i am looking for the same…


    DanielEngelhardt
    Participant

    @danielengelhardt

    i also have the problem, that only one profile field is shown per group, when i follow @graylien’s solution.
    @graylien, could you help out please? 🙂


    DanielEngelhardt
    Participant

    @danielengelhardt

    @vincefr did you solve it? Or anyone else?


    DanielEngelhardt
    Participant

    @danielengelhardt

    Yes it worked for me, thanks again. Here is the snippet which i am using in my functions.php:

    add_action('bp_core_activated_user', 'bp_custom_registration_role',10 , 3);
    function bp_custom_registration_role($user_id, $key, $user) {
       $userdata = array();
       $userdata['ID'] = $user_id;
       $userdata['role'] = xprofile_get_field_data('Ich bin', $user_id);
       
       if ($userdata['role'] == 'Dienstleister') {
            $userdata['role'] = 'dienstleister';
       }
       elseif ($userdata['role'] == 'Kunde') {
            $userdata['role'] = 'kunde';
       }
       //only allow if user role is my_role
       if (($userdata['role'] == "dienstleister") or ($userdata['role'] == "kunde")) {
            wp_update_user($userdata);
       }
      }

    DanielEngelhardt
    Participant

    @danielengelhardt

    yay, that was what i was looking for. Dont know why i didnt find it myself – sorry

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