Regrettably, your code does not work at my end. Tested with wpDiscuz 7.6.29, all plugins deactivated except essentials, and flushed all cache.
These are the test code snippets I used:
PHP Code Snippet: https://prnt.sc/sR0Sp3BGvxl_
JS Code Snippet: https://prnt.sc/l0YwnRKbuN-Y
Does it work at your end? How did you exactly implement it?
Thank you!
Hi @Asti,
Perfect! Worked like a charm.
Below please find the updated code snippet.
To see the code snippet in action, please visit this post and click on "Post Comment."
I cannot thank you enough for your help, dedication, and second-to-none plugin.
To help others, perhaps you can add this to your plugin's documentation?
Have a great week.
Cheers!
---------------------------
function wpdiscuz_button_feedack_onclick() { if ( is_singular( 'post' ) ) { ?> <script type="text/javascript"> jQuery(document).ready(function ($) { $(document).on('wpdiscuz_new_comment', function(e, btn, form, depth){ $(btn).val("Posting..."); }) $(document).on('wpdiscuz_comment_posted', function(e, btn, form, commentId, commentsCount){ $(btn).val('Post Comment'); }); }); </script> <?php } } add_action('wp_footer', 'wpdiscuz_button_feedack_onclick');
One final comment ... it would be great to further modify the above code snippet to allow the display of a "ajax spinner" instead of the word "Posting..." when the "Post Comment" button is clicked. I'll work on that. If successful, I'll post it here. Cheers!
Note: The use of an "ajax spinner" vs the word "Posting..." works best for websites that use plugins such as GTranslate (i.e., use a language dropdown selector). This would eliminate translation issues with the word "Posting..." Cheers!