Created
February 15, 2023 05:01
-
-
Save raftaar1191/622b85fa083d720a943619a3f6b4ee8c to your computer and use it in GitHub Desktop.
Do not allow the user to send the message when user client on the return button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Do not allow the user to send the message when they client on the return button | |
*/ | |
function bb_wp_footer_callback() { | |
?> | |
<script type="text/javascript"> | |
$( document ).ready(function() { | |
var el = document.getElementById( "message_content" ); | |
el.addEventListener("keydown", function(event) { | |
if (event.key === "Enter" && ! event.shiftKey ) { | |
event.preventDefault(); | |
} | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'bb_wp_footer_callback', 10000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.facebook.com/groups/buddyboss/?multi_permalinks=1672103693224466%2C1671871823247653%2C1671823233252512¬if_id=1676387360783939¬if_t=group_activity&ref=notif