brentdanley

Dude - URL replacement

Jun 25th, 2020
1,943
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3. function tag_href_replace(event) {
  4.  
  5.     const fields = jQuery('form#search-filter-form-39266 input:checked').serializeArray().map((checked) => checked.value)
  6.  
  7.     jQuery('.blog a.st-tags').each(function(){
  8.         this.href = this.href.replace("/tag/", `?sfid=39266&_sft_category=${fields}&_sft_post_tag=`)
  9.         this.href = this.href.replace(/sft_category=[a-z-,]*/, `sft_category=${fields}`)
  10.     })
  11.  
  12. }
  13. jQuery('form#search-filter-form-39266 input:checkbox').on("click", tag_href_replace)
  14. jQuery(window).on('load', tag_href_replace)
  15. </script>
RAW Paste Data