Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Pass Dynamic Value To Custom Redirect URL › Reply To: Pass Dynamic Value To Custom Redirect URL
Hi,
This may not be possible this way I’m afraid. The data is not shared on purpose, because each instance can have different filter setups and the initial values depend on both the query arguments as well as on the configuration. Different configurations require different data sent through the query arguments depending on the filter types.
Nevertheless, the ‘p_asid’ query argument determines which search ID the query arguments are referring to. With this code you can hook into that:
add_action('wp_footer', 'asp_custom_footer_script', 99999);
function asp_custom_footer_script() {
?>
<script>
document.addEventListener("DOMContentLoaded", (event) => {
WPD.Hooks.addFilter('asp_redirect_url', function(url){
return url.replace(
"p_asid=1",
"p_asid=2"
);
}, 10);
});
</script>
<?php
}
This changes the redirection from search ID=1 to search ID=2 so all the query arguments are passed on. However this does not guarantee that they will work unfortunately.