bp_ps_get_request( $type,  $form )

Gets BuddyBoss Profile Search request.

Description

Source

File: bp-core/profile-search/bps-search.php

function bp_ps_get_request ($type, $form=0)
{
	$current = bp_ps_current_page ();

	$cookie = apply_filters ('bp_ps_cookie_name', 'bp_ps_request');
	$request = isset ($_REQUEST[BP_PS_FORM])? $_REQUEST: array ();
	if (empty ($request) && isset ($_COOKIE[$cookie]))
		parse_str (stripslashes ($_COOKIE[$cookie]), $request);

	$cookie = apply_filters ('bp_ps_cookie_name', 'bp_ps_filters');
	$filters = bp_ps_hidden_filters ();
	if (empty ($filters) && isset ($_COOKIE[$cookie]))
		parse_str (stripslashes ($_COOKIE[$cookie]), $filters);

	switch ($type)
	{
	case 'form':
		if (isset ($request[BP_PS_FORM]) && $request[BP_PS_FORM] != $form)  $request = array ();
		break;

	case 'filters':
		if (isset ($request['bp_ps_directory']) && $request['bp_ps_directory'] != $current)  $request = array ();
		break;

	case 'search':
		if (isset ($request['bp_ps_directory']) && $request['bp_ps_directory'] != $current)  $request = array ();
		if (isset ($filters['bp_ps_directory']) && $filters['bp_ps_directory'] != $current)  $filters = array ();
		foreach ($filters as $key => $value)  $request[$key] = $value;
		break;
	}

	return apply_filters ('bp_ps_request', $request, $type, $form);
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.