Hi guys, do you have any idea how I can edit the text/image warning message - the one that visitors are getting when they try to submit a form but they get blocked ?
I mainly want to be able to add some more information about how the visitor can contact me in case he was blocked by error.
Currently, there is no convenient way to achieve this. We plan to implement it as a message editing feature soon. In the meantime, you can use a workaround by leveraging an additional PHP hook that takes advantage of WordPress localization and allows to modify the original phrase:
/**
* Modifies a given WP Cerber phrase.
*
* @param string $translated_text The translated string.
* @param string $text The original untranslated string.
* @param string $domain The text domain of the translation.
* @return string
*/
function modify_wp_cerber_phrase( $translated_text, $text, $domain ) {
// Check the original string and the text domain
if ( 'If you believe you should be able to perform this request, please let us know.' === $text && 'wp-cerber' === $domain ) {
return 'If you believe you should be able to perform this request, please contact us via email.'; // New phrase
}
return $translated_text;
}
add_filter( 'gettext', 'modify_wp_cerber_translation', 10, 3 );