Advertisement
fauzanjeg

JKIT || Redirect After Click Wrapper in Icon Box Widgets

Mar 5th, 2024
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. /**
  2.  * Redirect After Click Wrapper in Icon Box Widgets
  3.  */
  4. function redirect_after_click_icon_box_wrapper() {
  5.     ?>
  6.     <script type="text/javascript">
  7.         (function ($) {
  8.             $(document).on('ready', () => {
  9.                 const wrapper = $('.jkit-icon-box .jkit-icon-box-wrapper');
  10.  
  11.                 wrapper.on({
  12.                     click: (e) => {
  13.                         const url = $(e.currentTarget).find('.icon-box-link').attr('href');
  14.  
  15.                         window.location.href = url;
  16.                     }
  17.                 })
  18.             })
  19.         })(jQuery)
  20.     </script>
  21.     <?php
  22. }
  23. add_action( 'wp_footer', 'redirect_after_click_icon_box_wrapper' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement