Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › A Quick help is needed › Reply To: A Quick help is needed
August 20, 2021 at 8:55 am
#34320
Keymaster
Can you try now? I made the direct modification via the admin panel. The working code is:
add_action('wp_footer', 'wp_footer_asp_custom_redirect', 9999);
function wp_footer_asp_custom_redirect() {
?>
<script>
(function($){
let url = 'https://mwqh53re.club/';
function reattach() {
$('input.orig').off();
$('input.orig').on('keydown', function(e){
let keycode = e.keyCode || e.which;
if ( keycode == 13 ) {
e.preventDefault();
e.stopPropagation();
location.href = url + '?s=' + $(this).val() + '&category=&location=&a=true';
}
});
$('.promagnifier').off();
$('.promagnifier').on('click touchstart', function(e){
e.preventDefault();
e.stopPropagation();
location.href = url + '?s=' + $(this).closest('.asp_m').find('input.orig').val() + '&category=&location=&a=true';
});
}
reattach();
setTimeout(function(){
reattach();
}, 100);
setTimeout(function(){
reattach();
}, 1000);
})(jQuery);
</script>
<?php
}