Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Thank you Hugo.
    I am checking it now. will update you in 2-3 hours.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Hi Tiffany,
    We have looked into the plugin but are unable to replicate the error. There was no “IN, NOT In” operator support.

    Do you have any staging site where i can check your profile fields and the Rules for sugegstions.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Hi,
    Thank you for sharing the details.

    You can remove the plugin and put this code in theme theme’s functions.php

    
    
    /**
     * Xprofile data shortcode.
     */
    add_shortcode( 'bpc-profile-data', function ( $atts = array(), $content = null ) {
    
    	$atts = shortcode_atts(
    		array(
    			'context' => '', // logged, displayed, author
    			'user_id' => 0,
    			'field'   => '',
    		),
    		$atts
    	);
    
    	if ( empty( $atts['field'] ) ) {
    		return '';
    	}
    
    	$user_id = 0;
    	switch ( $atts['context'] ) {
    
    		case 'displayed':
    			$user_id = bp_displayed_user_id();
    			break;
    		case 'logged':
    			$user_id = get_current_user_id();
    			break;
    		case 'author':
    			$user_id = get_the_author_meta( 'ID' );
    			break;
    		default:
    			if ( $atts['user_id'] ) {
    				$user_id = $atts['user_id'];
    			} elseif ( in_the_loop() ) {
    				$user_id = get_the_author_meta( 'ID' );
    			} elseif ( bp_is_user() ) {
    				$user_id = bp_displayed_user_id();
    			} elseif ( is_user_logged_in() ) {
    				$user_id = get_current_user_id();
    			}
    	}
    
    	if ( ! $user_id ) {
    		return '';
    	}
    
    	return xprofile_get_field_data( $atts['field'], $user_id, 'comma' );
    
    } );
    
    

    Now, you can use the shortcode like this

    
    [bpc-profile-data field="About" ]
    

    You can use either the content or the user_id parameter to pass user context or id.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Hi Carsten,
    I am sorry for the delayed reply.

    By mistake, I had made the code to show the data only if the “Age” was set. Please use this instead

    
    
    /**
     * Buddypress Show Xprofile Field Data in The Profile Header.
     */
    
    function yzc_add_xprofile_field_data_in_profile_header( $name ) {
    
    	$field_data = xprofile_get_field_data( 'Age', bp_displayed_user_id() );
    
    	echo "<div class='profile-job-info'>";
    
    	echo '<br/><strong>Alder:</strong> ' . $field_data;
    
    	$field_data = xprofile_get_field_data( 'From', bp_displayed_user_id() );
    	if ( ! empty( $field_data ) ) {
    		echo '  <br/> <strong>Fra:</strong> ' . $field_data;
    
    		$field_data = xprofile_get_field_data( 'Job', bp_displayed_user_id() );
    		if ( ! empty( $field_data ) ) {
    			echo '<br/><strong>Job:</strong> ' . $field_data;
    
    		}
    
    		echo '</div>';
    	}
    }
    
    add_action( 'bp_before_member_header_meta', 'yzc_add_xprofile_field_data_in_profile_header' );
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Hi,
    Thank you for the reply.

    In community Builder 2.x, the only way to reorder nav is to either use BuddyPress Reorder Profile Tabs plugin or BuddyPress User Profile Tabs Creator Pro.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Hi Khalid,
    Thank you for letting us know. I am glad it is resolved.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Hi,
    Thank you for the topic.

    We do have a plugin for the same. I am asking @ravisharma to look into it and release.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490
    Brajesh Singh on in reply to: buddypress cover photo in crop format #36718

    Hi,
    Thank you for the questions.

    We are unable to assist you with the implementation if you are looking for a crop user interface like avatar uploader.

    If you want to set a hard crop instead of resizing(without any UI), please let me know. We will assist you.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25490
    Brajesh Singh on in reply to: Buddy press profile tabs #36717
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25490

    Thank you Tosin.