member-swap

Home Forums BP Profile Search Forum member-swap

This topic contains 1 reply, has 2 voices, and was last updated by  andrea 1 month, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10298 Reply

    Kenneth Yeung

    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
    Keymaster

    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]

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: member-swap
Your information: