member-swap

BP Profile Search › member-swap

  • Author
    Post
  • #10298 Reply
    Kenneth Yeung
    Guest

    I used the shortcode for the member-swap page – [bps_directory template=members/index-swap field_3=”Male”]. How can I make it to be field_3 = looking for field?

    #10299 Reply
    andrea
    Plugin Author

    Hi Kenneth,

    You can add this code to your bp-custom.php file:

    add_filter ('bps_hidden_filters', 'my_hidden_filters');
    function my_hidden_filters ($filters)
    {
    	$user_id = bp_loggedin_user_id ();
    	if ($user_id != 0)
    	{
    		$looking_for = xprofile_get_field_data (56, $user_id);
    		$filters['field_3'] = $looking_for;
    	}
    	return $filters;
    }

    Replace 56 with the actual field ID of your ‘looking for’ field.

    You can also remove the field 3 from your shortcode:

    [bps_directory template=members/index-swap]

Reply to: member-swap
My Information