Notifications
Clear all

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

6 Posts
2 Users
0 Reactions
1,084 Views
xfok
Posts: 86
 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: 3627
(@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: 86

@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: 3627

@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: 86

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

 

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3627

@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 } );