Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbpress Bad Words Error customize

  • @hamza21

    Participant

    Hi,
    I have added Words which are not allowed in the replies of forum in my Settings>Discussions>Disallowed Comment Keys and once I enter any of these words in replies of any of my forums posts an error is shown Your reply cannot be created at this time.

    Basically I want to customize the error and change it to my custom error which can be seen by user, I tried many ways like overwriting it by using hooks in my theme php file but not succeeded.

    Any help would be appreciated.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @robin-w

    Moderator

    try

    function rew_change_text( $translated_text, $text, $domain ) {
    	if ( $text == '<strong>Error</strong>: Your reply cannot be created at this time.') {
    	$translated_text = '<strong>Error</strong>: New moderation message';
    	}
    	return $translated_text;
    }
    
    add_filter( 'gettext', 'rew_change_text', 20, 3 );

    @hamza21

    Participant

    It shows nonce_failure error when I add the above code in my theme function.php file.

    @robin-w

    Moderator

    can you give me the exact error please

    @hamza21

    Participant

    nonce_failure
    its the exact error which I am getting.

    @robin-w

    Moderator

    ok, Can you show a few lines above and below where you put it in the functions file?

    @hamza21

    Participant

    Nonce-error

    Error Image

    @robin-w

    Moderator

    hmmm…

    try using

    Code Snippets

    The code works fine in my functions file

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar