Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,226 through 1,250 (of 3,575 total)
  • Author
    Search Results
  • #183096
    SimpleOne
    Participant

    @shanebp,

    OK, so this is interesting. When I tried inserting the code from @danbp in the functions.php file for another test site that I have, it worked! All 3 fields were successfully hidden during Profile Edit, and I no longer received the error message that all required fields must be filled in. Yippee!!!

    Still not sure why I cannot get this to work on my first site, though. FYI, I’m running BP 1.9.1 on that one, and on the other test site (where I got this to work), I’m running BP 2.0.1. I even tried removing all code from my functions.php file on my first site and just leaving the above code, but that didn’t make any difference. So I’m still scratching my head trying to understand why this would work on one of my sites, but not the other.

    NOTE: I did discover that this solution ONLY works if you do not have a required field set up in your base profile group. Otherwise, you will still receive the error message about needing to fill in required fields when you click the Save Changes button. I found a way to get around this by moving all required fields (like Display Username) out of the base profile group and putting those required fields in a different profile group.

    #183085
    shanebp
    Moderator

    danbp’s function works fine here.
    Although in BP 2.0+, bp_is_profile_edit() should be bp_is_user_profile_edit() to avoid the deprecation notice.

    Are you sure you’re inserting the correct ids?

    Try this and see if it hides the Name field:

    $retval['exclude_fields'] = '1';

    #183084
    SimpleOne
    Participant

    @danbp,

    Thanks. I tried inserting your suggested code into my functions.php, but it did not hide the desire fields. Also, I looked at the references in the links you provided for me to read through. Thanks for those too. However, I’m still stuck on how to resolve my problem.

    Just to be clear… I think what I specifically need to figure out is how to add a filter to bp_the_profile_group_field_ids(), which apparently creates a list of the expected field names (for the specific group tab that I’m currently on) when I click “Save Changes” button on Profile Edit page. Until I can find a way to filter out my 3 desired “required” fields during the Save Changes button press, I will continue to receive the error message: “Please make sure you fill in all required fields in this profile field group before saving“.

    Is there some other type of coding I can try to insert inside functions.php to resolve this?

    #183075
    danbp
    Participant

    Hi @SimpleOne,

    read from line 154 in bp-xprofile-classes.php file. It contains many information for what you want to do.
    See also on Codex here and here

    You can also revert your changes back and use this kind of function (goes into theme’s functions.php or bp-custom.php):

    function simple_one_hide_some_profile_fields( $retval ) {	
    	
    	if(  bp_is_profile_edit() ) {		
    		$retval['exclude_fields'] = '48';	//field ID's separated by comma
    		
    	}	
    	
    	return $retval;
    	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'simple_one_hide_some_profile_fields' );

    May this help ? 😉

    #183059

    In reply to: 2.1 top features

    stripedsquirrel
    Participant

    1) Change group slug (old plugin does not work).
    2) All possible types of X-profile fields (homepage URL, twitter URL, working multi-select boxes etc)
    3) x-profile fields that can be set by admin and not edited by user.
    4) Shortcodes or other options to display userquery based on x-profile fields. For example: display all users that have checked option ‘B’, all users that have run 2 marathons, all users from Europe etc.
    5) easy way to change all base-level slugs (groups -> teams, members-> runners etc).

    #183038
    SimpleOne
    Participant

    Correction to my last post. I meant to say…

    I was able to successfully hide certain profile fields from being displaying (by modifying profile-loop.php). And I was able to hide the same fields from being displayed when a user goes to edit their profile (by modifying edit.php).

    NOTE: Both files are located in: /bp-templates/bp-legacy/buddypress/members/single/

    I still need help figuring out how to avoid the above-mentioned “required fields” error message upon clicking the Save Changes button.

    #183032
    SimpleOne
    Participant

    Oops… I just found a problem.

    The good news is that I was able to successfully hide certain profile fields from being displaying (by modifying profile.php). That part works great. Also, I was able to hide the same fields from being displayed when a user goes to edit their profile.

    However, the problem I just discovered is that if any of those fields that I’ve hidden (using the above code changes) are “required” fields, then when a user goes to the Edit Profile page, the following error message appears upon clicking the Save Changes button: “Please make sure you fill in all required fields in this profile field group before saving.”

    Even though I’m certain those hidden fields have values in them, that error message appears and there’s no way to save changes.

    Any solution to this?

    #183027
    shanebp
    Moderator

    Try:

    while ( bp_profile_fields() ) : bp_the_profile_field(); 
    if ( bp_get_the_profile_field_id() != 'ID # YOU WANT TO SKIP' && bp_get_the_profile_field_id() != 'ID # 2nd field YOU WANT TO SKIP' ) :
    #182934
    julianprice
    Participant

    @antimuffin are you referring to extending profile fields. If so here’s the link for that which supports drop down select. however unsure if it supports conditional/dependent fields. You may have to look into a plugin.

    i.e
    Drop Down Select:
    – option 1 NAME
    – option 2 NAME
    – option 3 Other
    if other [TEXT BOX]

    Anyways here’s the link to codex https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/

    #182889
    mika89
    Participant

    It doesn’t seem to work :(.
    Maybe I’m not doing it in the good way…

    I also tried the function

    /**
     * Search the friends of a user by a search string.
     *
     * @param string $filter The search string, matched against xprofile fields (if
     *        available), or usermeta 'nickname' field.
     * @param int $user_id ID of the user whose friends are being searched.
     * @param int $limit Optional. Max number of friends to return.
     * @param int $page Optional. The page of results to return. Default: null (no
     *        pagination - return all results).
     * @return array|bool On success, an array: {
     *     @type array $friends IDs of friends returned by the query.
     *     @type int $count Total number of friends (disregarding
     *           pagination) who match the search.
     * }. Returns false on failure.
     */
    function friends_search_friends( $search_terms, $user_id, $pag_num = 10, $pag_page = 1 ) {
    	return BP_Friends_Friendship::search_friends( $search_terms, $user_id, $pag_num, $pag_page );
    }

    I called it this way : friends_search_friends('', $user_id, 0, 0);
    But doesn’t work

    #182826
    sharmavishal
    Participant

    1. Use BP Xtra Signup plugin and add an xprofile field of birth date

    2. Not sure on this but this plugin might help Buddypress Xprofile Custom Fields

    #182622
    kevinmorton
    Participant

    I’m looking for a solution to this as well. With a members directory that only shows a list of member names, the results are unintuitive unless I have a way to only search the member name, rather than all profile fields.

    #182553
    elaborate
    Participant

    I think I need to clarify that it’s the not being able to configure the WordPress profile in BuddyPress that I think is the issue. Displaying the fields is another side of it that I might agree should be left to a plugin developer.

    …it will require keeping up with WP if they decide to switch which fields are included on that page.

    I agree that this is an issue, but realistically, the WordPress profile hasn’t been updated in several years, apart from very recently when they actually removed fields in an effort to simplify it, so I doubt they intend to add anything to it either.

    The fields at wp-admin/profile.php are very odd, and not appropriate for most BuddyPress installations…

    As I mentioned above, those fields (AIM, Jabber and Yahoo/gTalk) were recently removed.

    As noted in the ticket, First Name and Last Name are the two possible exceptions I see here.

    That just leaves display name selection, nickname and website; email and password are configurable in BuddyPress and you already display username and bio on the profile when Extended Profiles are disabled. Why not allow the user to edit them too and add the remaining three fields? This would effectively move the profile to the front-end and nobody would need to configure their profile in two places again, which I think is the underlying issue here.

    …it causes problems when other plugins add their own (hardcoded) fields, which BP won’t know about

    I’m getting into deep water, but wouldn’t adding a hook before and/or after the fields be sufficient to deal with that?

    shanebp
    Moderator

    You may be interested in this premium plugin which allows you to select which profile fields appear in the listing for members in a group:

    BuddyProfileData

    #182543
    Boone Gorges
    Keymaster

    > I can’t find any arguments for not including the WordPress profile in BuddyPress.

    The arguments are:

    – The fields at wp-admin/profile.php are hardcoded in WP. There’s no way we can ask WP which fields it provides in a programmatic way; we’d have to hardcode them as well. This is inelegant; it causes problems when other plugins add their own (hardcoded) fields, which BP won’t know about; and it will require keeping up with WP if they decide to switch which fields are included on that page.
    – The fields at wp-admin/profile.php are very odd, and not appropriate for most BuddyPress installations (or most websites that were built after 2004 – who uses AIM, and who among them would want to store that information in their WP profile?)

    As noted in the ticket, First Name and Last Name are the two possible exceptions I see here.

    #182486
    Joe LeBeau
    Participant

    Buddypress really should have a character limit option for the profile fields and comments…

    #182471
    bp-help
    Participant

    @sooskriszta
    Sounds cool if there was a box or something beside each field in the dashboard/profile fields for admins to choose to be linkable.

    #182194
    Anonymous User
    Inactive

    Hi,

    Make sure to leave the base group profile fields available for all users

    Then explore in this direction :

    /* Profile display */
    function excluding_group_id_depending_on_user_role( $args = array() ) {
    	if ( user_can( bp_dispayed_user_id(), 'capability_to_check' ) {
    		$args['exclude_groups'] = "2,3,4"; //Comma-separated list of profile field group IDs to exclude
    	}
    	return $args;
    }
    add_filter( 'has_profile', 'excluding_group_id_depending_on_user_role', 10, 1 );

    /* profile editing */
    It will be a bit more complex as you’ll need to filter ‘xprofile_filter_profile_group_tabs’ and use a pattern to exclude the tabs you don’t want the role to edit.

    Finally to restrict group creation, i’ve shared a code on the BuddyPress fr community :
    http://bp-fr.net/agora/sujet/restreindre-la-creation-des-groupes-a-des-roles-wp/

    #182114
    investacube
    Participant

    Thanks for the quick reply @naijaping, I should have said that at the moment members changing their avatars is the only profile update that shows in my activity stream. I would like to add to that the changes made to personal profile fields. I appreciate the link to bp-tricks, I haven’t yet ventured into coding my own stuff but do you think the avatar change code is something that could be tweaked to include profile fields changes?

    klogan2
    Participant

    SO it seems the ‘Profile Details’ portion of the registration form, in spite of the fact that the people that wrote the BP app allow for ‘required’ fields in the ‘Profile Details’ portion of the form, neglected or forgot to include validating the ‘Profile Details’ portion of the form (OR chose NOT to),,,, anyone know how to do this???,,, as efficiently as it’s being done for say the user/email/password fields???
    I’ve been reading up on validating forms,,and it actually seems like something I could do, but not without rewriting the BP files,,which I would really like to avoid (BP updates would overwrite the changes). I would think it might be possible to do via the theme function files,,,but beyond adding a function here, or a filter there, my knowledge/experience wouldn’t be sufficient I think to accomplish this task,,,
    So,,any ideas/methods how to deal with this?? Answers would be greatly appreciated.
    Cheers, Kevin Logan

    klogan2
    Participant

    hmmm, no,, maybe I didn’t ask a silly question, I don’t think there ARE error fields for the extended profile registration fields,, along the lines of bp_signup_password_errors and then do_action( 'bp_signup_password_errors' ); in the appropriate places,,, which in this case would seem to be in the div class=editfield.
    Don’t know yet how to solve this,,, but thinking about it

    #182034

    In reply to: 2.1 top features

    SK
    Participant
    klogan2
    Participant

    The page does refresh (when a required field is left empty), drops one or 2 of the values (like month & year in a birthdate field),,, but doesn’t show the error messages for any blank fields in the Profile portion of the form.
    Thanks for your suggestion,,, I’d say that’s probably way over my head,,,I might be able to do it ‘eventually’,, but I hope an easier solution comes up 🙂
    Missing Error Messages in registration form

    #181946
    jerryskate
    Participant

    Yeah it might be correct, but it doesn’t work. I have tried pretty much anything regarding the body class, but the page doesn’t output anything i can use. It works at the main profile page, where my last slug is unique to the username, but as soon as you click on any tabs at the profile page, its lost, since the slug change to a more universal one. Here´s some of the things i tried, to no luck. https://wordpress.org/support/topic/give-pages-truly-unique-id´s-classes-possible?replies=23

    This is the page output:

      [page] => 0
        [pagename] => profile
        [error] =>
        [m] =>
        [p] => 0
        [post_parent] =>
        [subpost] =>
        [subpost_id] =>
        [attachment] =>
        [attachment_id] => 0
        [name] => profile
        [static] =>
        [page_id] => 0
        [second] =>
        [minute] =>
        [hour] =>
        [day] => 0
        [monthnum] => 0
        [year] => 0
        [w] => 0
        [category_name] =>
        [tag] =>
        [cat] =>
        [tag_id] =>
        [author] =>
        [author_name] =>
        [feed] =>
        [tb] =>
        [paged] => 0
        [comments_popup] =>
        [meta_key] =>
        [meta_value] =>
        [preview] =>
        [s] =>
        [sentence] =>
        [fields] =>
        [menu_order] =>
        [category__in] => Array
            

    As you can see the page doesn’t output a class unique to the profile, so doesn’t seems to work to filter the bodyclass.

    Must be another way of doing this?

    elaborate
    Participant

    I guess I might as well add the details now.

    My work so far has involved editing the bbPress and BuddyPress template files. I add the forms from the bbPress Edit page’s template file and paste them in the BuddyPress Settings page’s template file, which I then use.

    My problem is that the data for the users profiles does not appear in the relevant bbPress Edit fields now that the forms reside on the BuddyPress settings page with a different URL.

    I looked up how HTML forms work with PHP and found out that the action attribute in a <form> tag is the URL for the destination of the input, so you might think that changing the URL of the bbPress forms to the BuddyPress Settings page would solve the problem, but it doesn’t.

    Doesn’t the user data need to be sent to and retrieved from the database somehow?

    Thanks.

Viewing 25 results - 1,226 through 1,250 (of 3,575 total)
Skip to toolbar