Redirect to a URL after a property enquiry is submitted
If you’re using tracking codes (i.e Facebook Pixel) or analytics to measure property enquiries you might want to redirect the user to a new URL once a property enquiry has been made.
add_filter('propertyhive_make_property_enquiry_params', 'set_redirect_url');
function set_redirect_url( $params )
{
$params['redirect_url'] = '/thank-you/'; // The URL you wish to redirect to
return $params;
}
You could alternatively redirect back to the property details page, but perhaps with a query string parameter set in the URL:
add_filter('propertyhive_make_property_enquiry_params', 'set_redirect_url');
function set_redirect_url( $params )
{
global $post;
if ( isset($post->ID) )
{
$params['redirect_url'] = get_permalink($post->ID) . '?show_documents=1';
}
return $params;
}