Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Saurabh Jain
    Participant

    @saurabhsjain91

    Hi @danbp,
    What to say you man, you’re awesome thanks a lot for help. This was the only thing i wanted. Thanks to @danbp and @imath. 🙂 😀


    Saurabh Jain
    Participant

    @saurabhsjain91

    Hi @danbp, Thanks for all help it will help me more. For myself i made changes to code given by you and i was able filter members(users) according to skills(xprofile field) from this:

    function bpfr_field( $skill_field) { //$skill_field imported from do_action function
    	global $bp;
    	
    	// is xprofile component active ?
    	if ( bp_is_active( 'xprofile' ) )
    	
    	// fetch the user_id
    	$current_user = wp_get_current_user();
    	$current_user_id = $current_user->ID;
    	   $blogusers = get_users( ); //to get all user data from database
    	   
    	// Array of WP_User objects.
    	foreach ( $blogusers as $user ) {
    	// fetch the data
    		$sk = xprofile_get_field_data('8', $user->ID); // 8 is a field ID
    		// show the data
    		foreach($sk as $skill){
    			 if ($skill == $skill_field){
    			 	echo '<div class="authorinfo"><a href="http://YOUR_URL/members/' . $user->user_login . '/profile"
    			 	 target="_blank">' . $user->display_name . '</a></div>'; //to add link for user profile
    			 	}
    			 }
    		
    	//echo '<span>' . esc_html(  ) . '&nbsp</span>';
    	} 
        
    	
    }
    add_action( 'myfield', 'bpfr_field');
    

    I made a dropdown to select and skill value and attached it to do_action like this

    do_action( 'myfield', $skillname );

    and it worked.

    Thanks for your support, 1000 likes to your answer and help 🙂


    Saurabh Jain
    Participant

    @saurabhsjain91

    Thanks @danbp,
    Its cool thanks for answer, Will make changes according to me but u made me damn happy. Thanks once again.

    Thanks @1a-spielwiese too


    Saurabh Jain
    Participant

    @saurabhsjain91

    Thanks @1a-spielwiese,

    Is there any way to search users using xprofile fields.
    E.g. In my xprofile field i have named “Skills” i want to search all user having the Skill = I.T.
    I made Skills as checkbox.


    Saurabh Jain
    Participant

    @saurabhsjain91

    Thanks @1a-spielwiese and @danbp,
    I created new fields and didn’t updated profile that was the reason of not showing.

    Is there any way i can access the data in the fields. I created field named Skill i want to access the data in that field and use in other pages/post.


    Saurabh Jain
    Participant

    @saurabhsjain91

    Hello @joeyaberle,

    Me too asked that thing couple of days before, one of moderator told it is not possible yet but they gave me link to tutorial where we can make a form to request admin for group creation.

    http://bp-tricks.com/coding/manage-group-creation-by-creating-a-group-request-form/


    Saurabh Jain
    Participant

    @saurabhsjain91

    Hi @danbp,
    Thanks for response will try that.

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