Advertisement
brentdanley

Dude - URL replacement

Jun 25th, 2020
2,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.39 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement