• Resolved pawandongoloutside

    (@pawandongoloutside)


    How to change default validation message of hcaptcha in contact form 7?
    I need to change “Please complete the captcha.” validation message.

Viewing 1 replies (of 1 total)
  • Plugin Contributor kaggdesign

    (@kaggdesign)

    All messages from the plugin are sent via gettext API, according to WP standards. That is why you can use the gettext filter:

    
    /**
     * Filters text with its translation.
     *
     * @param string $translation Translated text.
     * @param string $text        Text to translate.
     * @param string $domain      Text domain. Unique identifier for retrieving translated strings.
     */
    function my_hcaptcha_message( $translation, $text, $domain ) {
    	if ( 'hcaptcha-for-forms-and-more' !== $domain || 'Please complete the captcha.' !== $text ) {
    		return $translation;
    	}
    
    	return 'My text for the completion of hCaptcha';
    }
    
    add_filter( 'gettext', 'my_hcaptcha_message', 10, 3 );`
    
    • This reply was modified 3 years, 2 months ago by kaggdesign.
Viewing 1 replies (of 1 total)
  • The topic ‘change default validation message’ is closed to new replies.