Notifications
Clear all

Script [Closed] Reply button automatically adds post author @nickname in editor

6 Posts
2 Users
0 Likes
863 Views
xfok
Posts: 78
 xfok
Topic starter
(@xfok)
Estimable Member
Joined: 5 years ago

how can disable Reply button automatically adds post author @nickname in editor?

5 Replies
Chris
Posts: 3650
(@chris)
Famed Member
Joined: 3 years ago

Hi @xfok,

Disable Show Member Mention Nicknames option from Dashboard  >Forums > Settings > Features tab.

4 Replies
xfok
 xfok
(@xfok)
Joined: 5 years ago

Estimable Member
Posts: 78

@chrisI tried, but it disables all mention functions, for example it also removes the @nick under the username. I would just like to disable the mention when clicking the lot reply in the QeA layout

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@xfok,

1. Download and Install "Code Snippets" Plugin for WordPress

2. Open Dashboard > Snippets > Add New 

3. Write a Title

4. Add the Below Code, Check the "Only run on site front-end" Checkbox and press Save Changes and Activate

add_action( 'wp_footer', function () { ?>
<script>

jQuery(document).ready(function ($) {
    if (typeof wpforo_editor !== 'undefined') {
        $('#wpforo-wrap').on('click', '.wpforo-qa-comment, .wpforo-reply.wpf-action.wpforo_layout_4', function () {
			setTimeout(function(){
				wpforo_editor.set_content('', $('.wpforo-post-form').data('textareaid'));
			}, 100);
        });
		$('#wpforo-wrap').on('click', ".wpforo-reply:not(.wpforo_layout_4)", function(){
			setTimeout(function(){
           		 wpforo_editor.set_content('', wpforo_editor.get_main());
			}, 100);
        });
		
    }
});

</script>
<?php } );
xfok
 xfok
(@xfok)
Joined: 5 years ago

Estimable Member
Posts: 78

@chris Thanks you. Work well but not work for first reply button. See attachments

 

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@xfok,

Insert this one 

add_action( 'wp_footer', function () { ?>
<script>

jQuery(document).ready(function ($) {
    if (typeof wpforo_editor !== 'undefined') {
        $('#wpforo-wrap').on('click', '.wpforo-qa-comment, .wpforo-reply.wpf-action.wpforo_layout_4', function () {
			setTimeout(function(){
				wpforo_editor.set_content('', $('.wpforo-post-form').data('textareaid'));
			}, 100);
        });
		$('#wpforo-wrap').on('click', ".wpforo-reply:not(.wpforo_layout_4), .wpforo-answer", function(){
			setTimeout(function(){
           		 wpforo_editor.set_content('', wpforo_editor.get_main());
			}, 100);
        });
		
    }
});

</script>
<?php } );