Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 851 through 875 (of 3,615 total)
  • Author
    Search Results
  • shanebp
    Moderator

    You can add profile fields via wp-admin > Users > Profile Fields

    You can search those fields with this plugin:
    https://wordpress.org/plugins/bp-profile-search/

    #249364
    shanebp
    Moderator

    My guess is that another plugin or some custom code or your theme is trying to apply a filter to
    bp_get_the_profile_field_id but the $field is not available.

    Try deactivating any plugins that deal with profile fields.

    To confirm that the issue is in your theme, try switching momentarily to a WP theme like 2013.

    #249218
    Turker YILDIRIM
    Participant

    I believe this not an issue because BP only needs an email, username and a password to do a succesfull registration. All other inputs may change for each site.

    You can use a plugin(like “contact form”) to create registration forms and then assign form inputs into custom created xprofile fields.

    #249114
    Xtremefaith
    Participant

    Still working on this, I discovered something while debugging:

        1) If I set my priority to 1​ like so:

        add_action('bp_core_activated_user', array( $this, 'setup_registration_metadata'), 1 );

        then in my setup_registration_metadata() function I use add_user_meta() to capture the first_name & last_name values at that point in time. Thankfully it makes an entry in the usermeta table with the expected value from get_user_meta($user_id, 'first_name', true)

        2) Unfortunately, something else apparently is hooked afterwards (possibly a method from the “Enable BuddyPress to WordPress profile syncing”, which then overrides any value I had set for those fields so that in the end the WordPress fields are now incorrect or wiped.

    It seems apparent to me that the “Enable BuddyPress to WordPress profile syncing” option is the culprit, but would that be a bug that the setting is grabbing the wrong values because even if I don’t hook into bp_core_activated_user the meta values that were successfully stored at registration are then wiped during activation? For example:

    • first_name becomes the username
    • last_name is cleared completely

    Setting the priority to 20 the results show that by that point the originally stored meta_value(s) have already been wiped.

    #249065
    shanebp
    Moderator

    ‘WordPress database error: [Unknown column ‘user_id’ in ‘field list’]’

    There is no user_id field in bp_xprofile_fields.
    The correct table is bp_xprofile_data.

    value is a text field, so you need quotes: AND value = '45'";

    Instead of AND value !empty"; try AND value != ''";

    $wpdb->get_var returns a single value. Try $wpdb->get_col.

    Your issues could have been solved by examining the table structure and reading reference docs like https://codex.wordpress.org/Class_Reference/wpdb.

    #249034
    Hellbounds
    Participant
    <?php do_action( 'bp_before_profile_loop_content' ); ?>
    
    <?php if ( bp_has_profile() ) : ?>
    	<ul class="accordion">
    	<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    
    		<?php if ( bp_profile_group_has_fields() ) : ?>
    
    			<?php do_action( 'bp_before_profile_field_content' ); ?>
    
    				<li>
    				  <h5 class="accordion-title <?php bp_the_profile_group_slug(); ?>"><?php bp_the_profile_group_name(); ?><span class="accordion-icon"></span></h5>
    				  <div class="accordion-content">
    						<dl class="dl-horizontal">
    
    							<?php  while ( bp_profile_fields() ) : bp_the_profile_field(); ?> 
    
    								<?php if ( bp_field_has_data() ) : ?>
    
    									<dt><?php bp_the_profile_field_name(); ?></dt>
    									<dd><?php bp_the_profile_field_value(); ?></dd>
    
    								<?php endif; ?>
    
    								<?php do_action( 'bp_profile_field_item' ); ?>
    
    							<?php endwhile; ?>
    						</dl>
    
    				  </div>
    				</li>
    			<?php do_action( 'bp_after_profile_field_content' ); ?>
    
    		<?php endif; ?>
    
    	<?php endwhile; ?>
    	</ul>
    	<?php do_action( 'bp_profile_field_buttons' ); ?>
    
    <?php endif; ?>
    
    <?php do_action( 'bp_after_profile_loop_content' ); ?>
    #249016
    Slava Abakumov
    Moderator

    “Tab Base”

    To delete Base and all other fields groups names in user profile:
    1. find in your theme file /buddypress/members/single/profile/profile-loop.php
    2. Delete in that file: this line: <h4><?php bp_the_profile_group_name(); ?></h4>

    If you don’t have such file in your theme, than copy this file:
    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
    into your theme here:
    /wp-content/themes/[your-theme]/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
    and remove the line that I wrote above (with h4).

    Members Directory – All Members

    1. find in your theme file /buddypress/members/index.php
    2. Delete in that file the line with this text: id="members-all"

    If you don’t have such file in your theme – do the same thing as written above but for index.php file.

    You should understand, that this will break ability to filter results on members directory page.

    #248982
    nickdanks
    Participant

    I thought this would be a buddy press question as the members relate to the plugin not users for our community website with custom profile fields.
    Thanks Nick

    #248850
    Slava Abakumov
    Moderator

    All fields that are in the first Base fields groups will appear on registration page.
    So you can just move those fields to another fields group, that you can create on this page /wp-admin/users.php?page=bp-profile-setup using this link http://cosydale.com/wp-admin/users.php?page=bp-profile-setup&mode=add_group.

    Another option

    Find the ID of a field that you want to hide in admin area (when you edit the field it’s in the URL like this /wp-admin/users.php?page=bp-profile-setup&group_id=1&field_id=2&mode=edit_field = field_id=2 is what you need), make sure that this field is NOT required, then open style.css of your theme and add there something like this:
    #profile-details-section.register-section .editfield.field_2 {display:none}
    For reference: http://take.ms/lONUD

    #248809
    Hastig
    Participant

    I’m probably misunderstanding the question but for the first part (“List each field where I want”) are you trying to control the order the fields appear to a user on this page?

    your.website/members/admin/profile/edit/group/1/

    If so, have you already tried reordering them in admin panel -> users -> profile fields ?

    #248807
    Hastig
    Participant

    This plugin may be of help to you..

    https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/

    This plugin add more fields type to Buddypress extension: Xprofile. The fields type added are: Birthdate.. Image.. Number within min/max values..

    #248409

    In reply to: Members – Masonry

    Hastig
    Participant

    without seeing your css i can give you an ugly, possible solution..

    (please backup that file before attempting the change)

    delete

    <div class=”profile_fields”><?php bp_member_profile_data(‘field=Organizational Name’); ?></div>

    replace

    <div class=”item-title”>
    <?php bp_get_member_name(); ?>
    </div>

    with

    <div class=”item-title”>
    <?php bp_get_member_name(); ?>
    <div style="display: block;"><?php bp_member_profile_data(‘field=Organizational Name’); ?></div>
    </div>

    you may want to change style="display: block;" to class="whateverName" and edit from your style sheet.

    #248408

    In reply to: Members – Masonry

    kmw1130
    Participant

    Here is my code. It is on the Members Page
    if ( function_exists(‘bp_is_active’) ) {
    if ( bp_has_members( $params ) ){
    ob_start();
    echo ‘<div class=”wpb_wrapper”>’;
    echo ‘<div id=”members-dir-list” class=”members dir-list”>’;
    echo ‘<ul id=”members-list” class=”item-list row kleo-isotope masonry ‘.$class.'”>’;
    while( bp_members() ) : bp_the_member();
    echo ‘<li class=”kleo-masonry-item”>’
    .'<div class=”member-inner-list animated animate-when-almost-visible bottom-to-top”>’
    .'<div class=”item-avatar ‘.$rounded.'”>’
    .’‘. bp_get_member_avatar() . kleo_get_img_overlay() . ‘‘;
    if ($online == ‘show’) {
    echo kleo_get_online_status(bp_get_member_user_id());
    }
    echo ‘</div>’
    .'<div class=”item”>
    <div class=”item-title”>’
    .’‘. bp_get_member_name() . ‘
    </div>
    <div class=”profile_fields”>’.bp_member_profile_data( ‘field=Organizational Name’ ).'</div>’;
    ‘<div class=”item-meta”><span class=”activity”>’.bp_get_member_last_active().'</span></div>’;

    if ( bp_get_member_latest_update() ) {
    echo ‘<span class=”update”> ‘. bp_get_member_latest_update().'</span>’;
    }

    do_action( ‘bp_directory_members_item’ ); echo ‘</div>’;
    echo ‘<div class=”action”>’;
    do_action( ‘bp_directory_members_actions’ );
    echo ‘</div>’;
    echo ‘</div><!–end member-inner-list–>
    ‘;
    endwhile;
    echo ‘‘;
    echo ‘</div>’;
    echo ‘</div>’;
    $output = ob_get_clean();
    }`
    }
    else
    {
    $output = __(“This shortcode must have Buddypress installed to work.”,”k-elements”);
    }

    #248267
    Xtremefaith
    Participant

    So does this mean you cannot use standard WordPress First & Last name fields, that if I want them accessible on their profile I have to use the xprofile component? Seems either redundant to keep them in both or a waste to not use the WP standard fields.

    Is there not an easy easy way to modify the profile form to make standard fields visible and editable?

    #248245
    shanebp
    Moderator

    I’m not aware of a plugin that does what you want.
    You might try https://wordpress.org/plugins/members-import/ as a starting place.
    You would need to modify the code to handle profile fields like postal codes.

    The search function would be separate.
    There are plugins that search profile fields, such as https://wordpress.org/plugins/bp-profile-search/

    #248077
    VersGemerkt
    Participant

    Jigesh,

    Thanks for the help! This is how it looks right now:

    Screenshot order.php

    As you can see to the right of the profile image their are some data showing from the custom fields. @mcUK and @shanebp helped me out achieving this. BUT, this is not the correct data it should be showing for this user… It shows data that the logged in user filled in.

    I logged in as the user that filled in the correct data, and then it’s showing the right data for the user. But this is because I’m logged in as that user…

    Screen

    NOTE: I’m transferring this data across two plugins: buddypress and learnpress. Just so you know!

    This is the php in bp-custom:

    <?php
    
    function bptest_show_a_field () {
    	$user_id = bp_loggedin_user_id();
    	$firstname = xprofile_get_field_data( 'First Name', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$lastname = xprofile_get_field_data( 'Last Name', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$birth = xprofile_get_field_data( 'Date of birth', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$education = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$profession = xprofile_get_field_data( 'Profession', bp_loggedin_user_id(), $multi_format = 'comma' );
     
    	if ( ! $firstname && ! $lastname && ! $birth && ! $education && ! $profession ) { 
    	   return; 
    	}   
    	else {
    	    echo 'Voornaam: ' . $firstname . '<br />' ; 
    	    echo 'Achternaam: ' . $lastname . '<br />' ; 
    	    echo 'Geboortedatum: ' . $birth . '<br />' ; 
    	    echo 'Hoogste graad: ' . $education . '<br />' ; 
    	    echo 'Beroep: ' . $profession . '<br />' ; 
            
    	}
    }
    
    add_action ( 'user_a_field', 'bptest_show_a_field' );
    ?>
     
    #248048
    @mcuk
    Participant

    Hi David,

    Copying the code method does work. (Renaming the function, the variables/fields within and the add_action bits).

    Just tried this out too and it appears to work fine, though not tested thoroughly so you’d need to double check:

    function bptest_show_a_field () {
    	$user_id = bp_loggedin_user_id();
    	$field_one = xprofile_get_field_data( 'Field One', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$field_two = xprofile_get_field_data( 'Field Two', bp_loggedin_user_id(), $multi_format = 'comma' );
     
    	if ( ! $field_one && ! $field_two ) { 
    	   return; 
    	}   
    	else {
    	   echo $field_one ; 
    	   echo $field_two ; 
    	}
    }
    
    add_action ( 'user_a_field', 'bptest_show_a_field' );

    Then put do_action ( 'user_a_field' ); in your desired location.

    #248044
    VersGemerkt
    Participant

    Got one question now that I’m working with the provided code:

    Do you have tips for using this code for multiple custom fields? How should I edit this code in bp-custom.php if I want to add multiple custom fields?

    <?php
    
    function bptest_show_education_field () {
    	$user_id = bp_loggedin_user_id();
    	$education_field = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' );
    	if ( ! $education_field  ) { 
    	   return; 
    	}   
    	else {
            echo 'Hoogste opleiding: ' . $education_field . '<br />'; 
    	}
    }
    add_action ( 'user_education_field', 'bptest_show_education_field' );
    ?>

    I’m now trying to copy this code for every custom field, but that’s not really a clean way of doing this. And it’s not working either. Hope you can help me out with this one as well!

    #247957
    VersGemerkt
    Participant

    Hi mcUK!

    Thanks for you reply. I’m working with Lotte on this issue.

    I tried adding your code. Everything should be in place right now, but it’s still not showing the custom fields. I’m probably using the code wrong…

    I tested your code with a custom field ‘Opleiding’ which I added in WordPress: Users -> Profile fields:

    Screenshot with the custom field

    I added this to bp-custom.php:

    <?php
    
    function bptest_show_opleiding_field () {
    	$opleiding_field = bp_get_member_profile_data( 'field=Opleiding' ); 
    	if ( ! $opleiding_field  ) { 
    	   return; 
    	}   
    	else {
    	   echo '<span class="custom-field-text">' . $opleiding_field . '</span>'; 
    	}
    }
    
    add_action ( 'user_opleiding_field', 'bptest_show_opleiding_field' );
    ?>

    Then I added this to order.php (the php file where the custom field should pop-up):

     <div id="user-opleiding">
    	                           <?php 
    		                          do_action ( 'user_opleiding_field' ); 
    	                           ?>
                                 </div>

    What am I doing wrong? It’s probably a typo or a wrongly added term… But I can’t figure out what it is!

    Hope you can help us out! Thanks for the help so far!

    David

    #247920
    @mcuk
    Participant

    Hi,

    Not used LearnPress so unable to comment much on that . The method I used to insert/display my own custom profile fields into a header on the user activity page was as follows (in this case, a Location field which was created in the WP dashboard).

    1. Add to bp-custom.php :

    //Add Location field to header if user has entered data into it
    //Nothing is shown if user hasn't entered anything into field
    function bptest_show_location_field () {
    	$location_field = bp_get_member_profile_data( 'field=Location' ); 
    	if ( ! $location_field  ) { 
    	   return; 
    	}   
    	else {
    	   echo '<span class="custom-field-text">' . $location_field . '</span>'; 
    	}
    }
    //user_bio_location_field is used within the member-header php template file
    add_action ( 'user_location_field', 'bptest_show_location_field' );

    2. In my member-header.php file (which was copied into my child theme) entered the div :

    <div id="user-location">
    	<?php 
    		do_action ( 'user_location_field' ); 
    	?>
    </div><!-- #user-location - function is found in bp-custom -->

    Obviously the php code in step two is placed wherever you want the field to display, just put it in the correct location of the correct php file. In my case it was member-header.php but for you i’m guessing its the one that generates your order page?.

    Not sure if you have already tried any of that or if it even helps!

    #247908
    dlongm01
    Participant

    In fact I have found a reasonable solution using CSS. I found some key clues on in the support forum for this plugin: Buddypress Xprofile Custom Fields Type (though I’m not using that plugin).

    If anyone has any advice about how to improve this I would be glad to hear it. Thanks

    /* Buddypress profile field description position*/
    .editfield {
    position: relative;
    top: 5px;
    }
    .editfield label {
    font-weight:bold;
    margin-bottom: 30px;
    }
    .input field_4 {
    margin-top: 5px;
    }

    form.standard-form p.description {
    margin: 0 0 15px;
    position: absolute;
    top: 20px;
    line-height:1em;
    }

    #247832
    AdventureRidingNZ
    Participant

    Add me to the list. I want to be able to have a page with a members list which lists 6 xprofile fields if a particular one of those fields is populated.

    #247622

    In reply to: Repeating Group Tabs

    NickAcs
    Participant

    Just an additional note to this issue – each time I refresh/revisit Profile Fields in the backend, more “Social” and “CoverOptions” tabs are added. The list grows!

    George Notaras
    Participant

    @sbrajesh

    Hi Brajesh,

    Thank you very much for the insight. Your reply clarifies a lot of things for me. Really enlightening.

    I was planning to make my plugin able to understand the following field notation:

    
    some field name @ some field group
    

    for easier/friendlier association of xprofile fields to profile properties, for which the plugin can generate metadata.

    Now that I have this information, I’ll have to rethink about the implementation.

    Thanks again!

    Best Regards,
    George

    Brajesh Singh
    Participant

    Hi George,
    No, There is no API function to fetch field group id from field group name and you will need to write your own sql query for the purpose.

    Also, In your example you have passed the profile_group_id to the bp_get_profile_field_data. Please note, it does not take that as a valid argument. It only accepts user_id and field. group id is not required for fetching field data.

    Now, If we forget about the group name API and come to the original requirement, Do you plan to fetch the data for multiple users(In loop) or just once/twice.

    For fetching data, these two functions work

    You can either use

    
    $data = xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' )
    
    

    where $field is field id or name( If you know the id, It will fetch from any group, Name has the issue)

    or as you specified

    
    $data = bp_get_profile_field_data( array(
    	'user_id'	=> $user_id,
    	'field_id'	=> $field
    	
    ) );
    
    

    The xprofile data APIs do not allow passing group in general. You either pass a field id or name.

    The problem will happen when multiple fields have same name. In that case, the first field with the name matches if you use the above functions.

    Another point, In both the cases, There is no group arguement and if you use field name, that will need one extra query(field id should be preferred if the id is known).

    Honestly speaking, It is ok to use it one or 2 time on page but avoid using it inside the loop. If you plan to use it inside the loop, you should try to first fetch the xprofile data and cache and then use any of these functions. One way to cache will be by calling

    
    
    BP_XProfile_ProfileData::get_value_byid( $field_id, $user_ids )
    

    Where $field_id is the id of field(not name) and $user_ids is one or more user ids.

    Hope that helps.

Viewing 25 results - 851 through 875 (of 3,615 total)
Skip to toolbar