Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1 through 25 (of 4,714 total)
  • Author
    Search Results
  • Profile photo of k4tn1x
    k4tn1x
    Participant

    Hi !

    I modify extended profile fields using a HTML form and with the function xprofile_set_field_data. My question is :
    There is a function to modify the extended profile picture using the <input type="file"> of HTML form ?

    Thank you and have a good day !

    #256918
    Profile photo of Username
    crawlinson
    Participant

    Ah HA! My apologies, it seems as though conditional visibility is not a core feature of BP. As I am working with another developer I didn’t realise they had added this functionality through a plugin called “conditional profile fields for buddypress” https://buddydev.com/plugins/conditional-profile-fields-for-buddypress/

    Sorry!

    Profile photo of johnrobertsonsquid
    johnrobertsonsquid
    Participant

    Hello,

    My site is currently running in BuddyPress Version 2.6.1.1 and YOAST SEO Version 3.4.

    I’ve been wanting to achieve in the Meta Title something like:
    John: Age / Gender / City – Domain.com where John is the name field from buddypress and where age/gender/city are the xprofile fields.

    Now, disabling Yoast SEO and when visiting a member’s profile it will show Name - Domain.com but enabling Yoast SEO it will only show the site name e.g. - Domain.com.

    How can I be able to use buddypress profile fields to be on the meta tag? Like what I’ve been wanting to achieve above.

    Any help is appreciated.

    Thanks.

    #256823
    Profile photo of danbp
    danbp
    Moderator

    @eli225, please calm down. @sharmavishal is only trying to help you !

    It’s not easy trying to help people asking questions without giving much details. It’s the case with this topic and your previous. Have you even read this before asking ?

    This is not possible: Buddypress Profiles Display In Wrong Order as it is not BP but the site admin who determines this.

    xprofile fields and xprofile field groups (what you call section i suppose ) are drag’n’dropable.

    If despite a correct positionning in the backend, the order changed on front-end, two possibilities: the drag’n’drop was to fast or there is a js error/latentency/cookie somewhere. And this is generally due to the theme in conflict with a plugin (which could be BP).

    Unfortunately, kleo is a premium theme for which you can’t expect assistance here, as we have no access to it’s code.

    For the part related to BuddyPress, note that the actual version works flawlesly with the xprofile component. Nobody related a similar issue to yours recently.

    So back to handcrafted annoying but very related questions:
    What do you call section ?
    Which type of field do you use ?

    Also related to general debug work:
    Have you tested with another theme ?
    Have you tested without any other plugin as BP ?

    #256790
    Profile photo of danbp
    danbp
    Moderator

    On a default single install, all users can access their credentials via your-site/wp-admin/profile.php

    From there they have access to the WP fieldss and to the extended profil fields.

    From there, they can change email & password.

    Admitting you closed admin access to all users, the only other way for them to modify there email and password is to use the “forgotten your password ?” at loggin stage.

    All this is not really a BP thing, but how WP is working since 2003.
    The 3 mandatory field (username, email and password) belonging exclusively to WP. They are showed on registration, ASIDE BuddyPress custom fields. BP doesn’t exactly handle them, it only show them. And as these fieds are WP territory and a bit sensible, they are not accessible from within frontend profile settings.

    Guess the word “critical’ is a bit exagerated. Not every user change his mail or password every day. How long do you wait for a new phone number or new electricity supply ? Probably more critical things as a mail/password change !

    #256779
    Profile photo of jagarolik
    jagarolik
    Participant

    Okay, that’s a good start – I’ve installed BP XProfile WordPress User Sync, but there are several critical wordpress account fields inaccessable from BP.

    – account email
    – account password

    These are critical, as people change their emails and passwords – and there is no way to do this right now through BP as is.

    Profile photo of jagarolik
    jagarolik
    Participant

    Hi All,

    I’ve going down a long path to try and merge buddypress and wordpress “edit profile” pages. Long story short, I’m trying to keep users out of the back end entirely if I can, but they need to be able to edit their wordpress profile somewhere, and logically, it ought to be with the other “edit profile” stuffs.

    I’ve found a few free plugins to assist with this, “BuddyPress Xprofile Custom Fields Type” and “Profile Builder”

    Profile builder allows me to put a shortcode anywhere in order to allow somebody to edit their profile in the front end. I need to insert this shortcode into a new “field group” in “xprofile custom fields” but I can’t just drop in a shortcode there, only editable fields are permitted – furthermore, if I put any editable fields into the “field group” then that group will have a save button as well as the one produced by my shortcode!

    Any suggestions? Also willing to entertain a different suggestion altogether.

    Thanks!

    #256752
    Profile photo of buddycore
    buddycore
    Participant

    You’re going into a pretty complicated MySQL query.

    $field_id = SELECT id FROM wp_bp_xprofile_fields WHERE name = Profile Field

    $users = SELECT DISTINCT user_id FROM wp_bp_xprofile_data WHERE value = enterprise AND field_id = $field_id

    Then you’re gonna be implementing a foreach loop in PHP.

    That’s the approach I would take, it’s quite in-depth and I’m working on something else at the moment but hopefully that gives you an idea of where to look.

    Profile photo of k4tn1x
    k4tn1x
    Participant

    Hi !
    I want to get users filtering by a specific extended profile field, for example :
    I want all users where extended profile field “enterprise” value is “WordPress”. How can I do this please ?
    For now i’m using get_users() to get all users and I display their extended profile fields with bp_profile_field_data().

    Thank you and have a good day !

    #256734
    Profile photo of sharmavishal
    sharmavishal
    Participant

    you can sort the order in the wp backend by going to profile fields

    Profile photo of eli225
    eli225
    Participant

    Hello,

    For some reason our buddypress profile information is displaying in the wrong order when you click ‘view’ on a profile. Can anyone please help?

    This is the information fields we created in users>profile fields.
    Example
    should display on profile in this order section 1, section 2, section 3.
    But displays as section 3, section 1, section 2. or some other order.

    Thanks

    #256715
    Profile photo of gorbett
    gorbett
    Participant

    SOLUTION (finally)

    Thanks @henrywright and @coffeywebdev for pointing me in the right direction. Here is what I ended up with.
    1. Enable child theme and copy the BP register.php file to the child theme.
    2. In the child theme’s style.css, I entered to remove the xprofile fields from the register.php page:
    .editfield {
    display: none;
    }
    3. In the child theme’s functions.php file I have this (again, reassign the xprofile fields ‘field_3’ and ‘field_4’ because of their position in the DOM:

    add_action( ‘bp_signup_pre_validate’, ‘assign_username’ );

    function assign_username(){
    if ( isset( $_POST[‘first_name’] ) ) {
    $_POST[‘field_3’] = $_POST[‘first_name’];
    $_POST[‘field_4’] = $_POST[‘last_name’];
    $_POST[‘signup_username’] = create_username();
    foreach ($_POST as $key => $value) {
    echo $key . “: “;
    echo $value;
    echo “<br>”;
    }
    exit();
    }
    }

    function create_username() {
    $i = 0;
    $username = $_POST[‘field_3’] . $_POST[‘field_4’];
    while (username_exists( $username )) {
    $username = $username . ++$a;
    }
    return $username;
    }

    I am simply creating a username from first name and last name and then start to append a number when inevitably someone with the same name registers. I need to add more validation on the username to ensure that it is <= 50 characters, but this finally worked for me.

    Thanks again to the community for pointing me in the right direction!

    #256712
    Profile photo of gorbett
    gorbett
    Participant

    Issue now is with the extra BP fields coming later in the DOM than my fields on my register.php. Even though I have the css set to display: none for the actual xprofile fields, my fields are not carrying through the $_POST values because display: none does not remove the fields from the DOM.

    I guess I can try adding hidden fields after the xprofile fields and set them to the values being entered in my fields, but that seems kinda clumsy.

    I added test code to check the $_POST values at where I can see the fields coming over as empty strings: https://pantest.centralus.cloudapp.azure.com/register/

    #256705

    In reply to: member address

    Profile photo of danbp
    danbp
    Moderator

    @pws2015

    assuming your fields names are Address, City and Postal code, add this snippet to bp-custom.php and any logged-in user will see these fields on the Member Directory page underneath the already existing informations.

    function bpex_address_on_directory(  ) {	
    
    if( bp_is_active( 'xprofile' ) && is_user_logged_in() ) :
    
    	echo '<p>';
    
    	if ( $address = xprofile_get_field_data( 'Address', bp_get_member_user_id() ) ) :
    		echo $address.'&nbsp;';
    	endif;
    
    	if ( $zipcode = xprofile_get_field_data( 'Postal code', bp_get_member_user_id() ) ) :
    		echo $zipcode .'&nbsp;';
    	endif;
    
    	if ( $city = xprofile_get_field_data( 'City', bp_get_member_user_id() ) ) :
    		echo $city .'&nbsp;';
    	endif;
    
    	echo '</p>';
    
    endif;
    
    }
    add_filter ( 'bp_directory_members_item', 'bpex_address_on_directory' );
    #256702

    In reply to: member address

    Profile photo of sharmavishal
    sharmavishal
    Participant

    As mentioned:

    In the WordPress dashboard, find under “Users” a link titled, “Profile Fields” (Users>Profile Fields)

    Here you can add profile fields to the signup process,

    in your case add address, city and postal code fields

    if above is added and you are not able to see then check the visibility of this 3 fields

    #256683

    In reply to: member address

    Profile photo of coffeywebdev
    coffeywebdev
    Participant

    In the WordPress dashboard, find under “Users” a link titled, “Profile Fields” (Users>Profile Fields)

    Here you can add profile fields to the signup process, if you don’t want to add the fields to signup you need to add a new field group.

    The field group ‘Base’ is added to signup process

    I hope that helps

    #256668

    In reply to: BP exclude member role

    Profile photo of pws2015
    pws2015
    Participant

    Hi,
    In this file: wp-content/plugins/bp-custom.php i add this:

    function buddydev_exclude_users_by_role( $args ) {
    	//do not exclude in admin
    	if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
    		return $args;
    	}
    	
    	$excluded = isset( $args['exclude'] )? $args['exclude'] : array();
    
    	if( !is_array( $excluded ) ) {
    		$excluded = explode(',', $excluded );
    	}
    	
    $tab_role=array('administrator','subscriber','author','contributor','editor');
    	foreach($tab_role as $k=>$role){
    	//$role = ;//change to the role to be excluded
    	$user_ids =  get_users( array( 'role' => $role ,'fields'=>'ID') );
    	
    	
    	$excluded = array_merge( $excluded, $user_ids );
    	}
    	
    	$args['exclude'] = $excluded;
    	
    	return $args;
    }
    

    So i exclude all role but i have custom role which users of this role are only can see they profiles in member page

    #256646
    Profile photo of shanebp
    shanebp
    Moderator

    modifying the general.php template

    There is no such template in a standard BP install, afaik.

    But there is an easier way to add a field…
    Why not add a profile field in the proscribed manner?
    In wp-admin, go to Users > Profile Fields and add your field to whichever Group you want.
    All fields in the Base Group will appear on the Registration page.

    Profile photo of had_hc
    had_hc
    Participant

    Hi, I’m trying to add some custom fields to the buddypress profile general settings section by modifying the general.php template. There’s no issue in outputting the fields. My issue is only saving the field. From what I know, I can use the wp_nonce_field( 'bp_settings_general' ); nonce in my function to save the field.
    Say I have these in general.php

    <input type="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" />
    <label for="billing_phone" class="">Phone <abbr class="required" title="required">*</abbr></label>
    <input type="tel" class="settings-input " name="billing_phone" id="billing_phone" placeholder="" autocomplete="tel" value="<?php echo get_user_meta($user_id, 'billing_phone', true); ?>"></p>

    Here’s what i did to save it (I put it in function.php)

    unction save_wc_address () {
    	if ( wp_verify_nonce( $_POST['bp_settings_general'] ) ){		
    
    		$user_id = sanitize_text_field( $_POST['user_id'] );
    
    		//sanitize input data
    		$billing_phone = sanitize_text_field( $_POST['billing_phone'] );
    
    		//update user meta
    		update_user_meta( $user_id, 'billing_phone', $billing_phone);
    
    	}
    }
    add_action( 'bp_init', 'save_wc_address' );

    As I said above, it’s not saving when I change the phone number and click submit. Can anybody point me out what I did wrong? Thanks in advance!

    Profile photo of Jeremy Pry
    Jeremy Pry
    Participant

    Under certain circumstances, there is an infinite loop inside the bp_legacy_theme_new_activity_comment() function. Specifically, when all of the secondary_item_id fields are zero, the $parent_id will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.

    This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/

    For information:

    • WordPress 4.5.3
    • BuddyPress 2.6.1.1
    • Single site install in web root
    • There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
    • We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
    • The core BuddyPress files have not been modified to my knowledge.
    • The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
    • The live site is http://www.lifeofdad.com/

    I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned bp_legacy_theme_new_activity_comment() function.

    My specific concern is this loop:

    
    	// Load the new activity item into the $activities_template global.
    	bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id );
    
    	// Swap the current comment with the activity item we just loaded.
    	if ( isset( $activities_template->activities[0] ) ) {
    		$activities_template->activity = new stdClass();
    		$activities_template->activity->id              = $activities_template->activities[0]->item_id;
    		$activities_template->activity->current_comment = $activities_template->activities[0];
    
    		// Because the whole tree has not been loaded, we manually
    		// determine depth.
    		$depth = 1;
    		$parent_id = (int) $activities_template->activities[0]->secondary_item_id;
    		while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) {
    			$depth++;
    			$p_obj = new BP_Activity_Activity( $parent_id );
    			$parent_id = (int) $p_obj->secondary_item_id;
    		}
    		$activities_template->activity->current_comment->depth = $depth;
    	}
    

    I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.

    I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.

    I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.

    
    +--------------------------------------+--------+-----------+---------+
    | name                                 | status | update    | version |
    +--------------------------------------+--------+-----------+---------+
    | akismet                              | active | none      | 3.1.11  |
    | all-in-one-seo-pack                  | active | available | 2.3.7   |
    | appbuddy                             | active | available | 2.0.7   |
    | appcamera                            | active | available | 2.0.0   |
    | appfbconnect                         | active | none      | 2.3.0   |
    | apppresser                           | active | none      | 2.5.0   |
    | apppush                              | active | available | 2.1.0   |
    | appshare                             | active | none      | 2.1.0   |
    | appswiper                            | active | available | 2.2.1   |
    | bp-profile-search                    | active | none      | 4.5.2   |
    | buddypress                           | active | none      | 2.6.1.1 |
    | buddypress-activity-plus             | active | none      | 1.6.4   |
    | bp-moderation                        | active | none      | 0.1.7   |
    | buddypress-nocaptcha-register-box    | active | none      | 1.1.3   |
    | buddypress-toolbar                   | active | none      | 1.6.0   |
    | buddypress-wall                      | active | none      | 0.9.4   |
    | buddypress-xprofile-image-field      | active | none      | 2.0.1   |
    | category-posts                       | active | none      | 4.6.1   |
    | contact-form-7                       | active | none      | 4.4.2   |
    | contact-form-7-to-database-extension | active | none      | 2.10.20 |
    | cubell-themes-functionality          | active | none      | 3.1     |
    | envato-wordpress-toolkit             | active | none      | 1.7.3   |
    | hashbuddy                            | active | none      | 1.5.2   |
    | login-with-ajax                      | active | none      | 3.1.6   |
    | mailchimp-for-wp                     | active | none      | 3.1.11  |
    | nav-menu-roles                       | active | none      | 1.8.2   |
    | nextend-facebook-connect             | active | none      | 1.5.9   |
    | buddypress-media                     | active | none      | 4.0.4   |
    | vine-embed                           | active | none      | 0.2     |
    | wds-lod-automatic-friends            | active | none      | 0.1.0   |
    | wds-lod-base                         | active | none      | 0.1.0   |
    | wds-lod-bp                           | active | none      | 0.1.0   |
    | wds-lod-post-types                   | active | none      | 0.1.0   |
    | wds-lod-widgets                      | active | none      | 0.1.0   |
    | wordpress-importer                   | active | none      | 0.6.1   |
    +--------------------------------------+--------+-----------+---------+
    
    #256575
    Profile photo of coffeywebdev
    coffeywebdev
    Participant

    In the WordPress dashboard, find under the Users menu a link titled, “Profile Fields”(Users>Profile Fields)

    Once you click on this link, then you can add new fields to the profile by clicking the Add New Field button.

    When you’ve added a field to the Base(Primary) field group, then it will appear on your registration pages and user profiles.

    #256573
    Profile photo of coffeywebdev
    coffeywebdev
    Participant

    Copy the buddypress theme into your WordPress child theme, and then you can modify the register template if needed.

    copy the buddypress theme into your child theme by pasting this path into your child theme folder
    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress

    path of file for registration fields is this:
    /wp-content/themes/child-theme/buddypress/members/register.php

    Then, add First and Last name fields under User>Profile Links in the WordPress Dashboard.

    Currently there is a ‘Name’ field that is required, you can edit it to read ‘First Name’ then add another ‘Last Name’ field..

    Then you need to process the data before it saves into the database, I’m kind of at a loss here… I would need more time to brainstorm on it but I did find this hook ‘bp_core_signup_user’

    I believe this is the hook you are looking for:

    // define the bp_core_signup_user callback 
    function action_bp_core_signup_user( $array, $int, $int ) { 
        // make action magic happen here... 
    }; 
             
    // add the action 
    add_action( 'bp_core_signup_user', 'action_bp_core_signup_user', 10, 3 ); 
    #256530
    Profile photo of sunilkumark
    sunilkumark
    Participant

    Hi,

    I am new to wordpress. I created some profile fields using buddy press in signup page.

    After clicking the sign-up page the values which I am submitting is not saved in db.

    How can I fix this ? Kindly somebody help me.

    #256516
    Profile photo of danbp
    danbp
    Moderator

    Hi,

    it’s not the solution but an example you can perhaps use.
    The snippet handles the object members and sort them by type “contributing”
    Replace object by activity and type by “beer” and see what you can do from that.

    // add order options to members loop
    function ch_member_order_options() {
    ?>
       <option value="contributing"><?php _e( 'Contributing Members', 'buddypress' ); ?></option>
    <?php
    }
    add_action( 'bp_members_directory_order_options', 'ch_member_order_options' );
    
    // filter ajax members by contributing
    function ch_filter_ajax_querystring( $querystring = '', $object = '' ) {
    
    	if( $object != 'members' )
    		return $querystring;
    
    	$defaults = array(
    		'type'            => 'active',
    		'action'          => 'active',
    		'scope'           => 'all',
    		'page'            => 1,
    		'user_id'         => 0,
    		'search_terms'    => '',
    		'exclude'         => false,
    	);
    
    	$ch_querystring = wp_parse_args( $querystring, $defaults );
    
    	if( $ch_querystring['type'] == 'contributing' ) {
    	
           // grab members by Member Type role declared on xprofile	
    	$users = get_users( array( 'fields' => array( 'ID' ), 'role' => 'contributor' ) );
    		
    		$users_str = '';
    		foreach ( $users as $user ) {
    				 $users_str .=  $user->ID . ',';
    			}
    		$users_str = rtrim($users_str, ",");
    
    		$ch_querystring['include'] = $users_str; 
    		$ch_querystring['type'] = 'alphabetical'; 
    		
    		return $ch_querystring;
    		
    	}	
    	
    	else
    		return $querystring;
    			
    }
    add_filter( 'bp_ajax_querystring', 'ch_filter_ajax_querystring', 20, 2 );

    https://buddypress.org/support/topic/adding-new-order-by-on-members-loop/

    Members Loop

    Member Types

    #255942

    In reply to: Profile Fields

    Profile photo of danbp
    danbp
    Moderator

    It’s not a duplicate, but how it works.
    On the left, you have the WP field for “username”, on the right BP’s mandatory field “name”. Both are used for registering a new user. WP’s username field accept only lower case alphanumerics without space. Mostly used to enter a pseudonym. BP’s field accept uppercase and space or even carets, wich allows to enter first and last name for example.

    Note that you’re not obligated to enter a first and last name. If you rename Name to City or Gender, a user must enter a city name or his gender. Eg. username: johnrobertsonquid | city: Los Angeles or username: johnrobertsonquid | gender: male

    But whatever the field may contain, it cannot be removed.

    About xprofile fields:

    User Extended Profiles

Viewing 25 results - 1 through 25 (of 4,714 total)
Skip to toolbar