How to add variables to the “redirect to url” or the “show more url”?
This will only work on plugin version 4.9.5 or later!
Both strings are filtered before output, so you can use a custom function to do the job:
What is this, and where do I put this custom code? Change the $values array to add/remove query param=>value pairs.
1
// Use this to change the "redirect to url" parameter
2
add_filter( 'asp_redirect_url', 'asp_add_params_to_url', 1, 10 );
3
// Use this to change the "show more results url" parameter
4
add_filter( 'asp_show_more_url', 'asp_add_params_to_url', 1, 10 );
5
6
function asp_add_params_to_url( $url ) {
7
// Array of param names and values
8
$values = array(
9
"param1" => "value1",
10
"param2" => "value2",
11
"param3" => "value3"
12
);
13
// Merge them together
14
foreach ( $values as $k => $v )
15
$url .= "&".$k."=".$v;
16
17
return $url;
18
}
Copied!
Last modified 1yr ago
Copy link