Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/ad91a8f62e7138d9742352096abde1e9 to your computer and use it in GitHub Desktop.
Save KaineLabs/ad91a8f62e7138d9742352096abde1e9 to your computer and use it in GitHub Desktop.
edirect "Join Group" Button After Click.
<?php
/**
* Redirect "Join Group" Button After Click.
*/
function yzc_redirect_join_group_button_to_group() {
?>
<script type="text/javascript">
jQuery( document ).ready( function(){
$( '.join-group' ).on( 'click', function( e ) {
e.stopImmediatePropagation();
// Redirect to link
window.location.href = $( this ).attr( 'href' );
});
});
</script>
<?php
}
add_action( 'wp_footer', 'yzc_redirect_join_group_button_to_group' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment