How to add variables to the “redirect to url” or the “show more url”?
// Use this to change the "redirect to url" parameter
add_filter( 'asp_redirect_url', 'asp_add_params_to_url', 1, 10 );
// Use this to change the "show more results url" parameter
add_filter( 'asp_show_more_url', 'asp_add_params_to_url', 1, 10 );
function asp_add_params_to_url( $url ) {
// Array of param names and values
$values = array(
"param1" => "value1",
"param2" => "value2",
"param3" => "value3"
);
// Merge them together
foreach ( $values as $k => $v )
$url .= "&".$k."=".$v;
return $url;
}PreviousHow to add shortcode to the results content?NextIndexing Shortcodes within custom field contents
Last updated