library/Comment/CommentsFilters.php
public function validateReCaptcha()
    {
        if (is_user_logged_in()) {
            return;
        }

        $response = isset($_POST['g-recaptcha-response']) ? esc_attr($_POST['g-recaptcha-response']) : '';
        $reCaptcha = \Municipio\Helper\ReCaptcha::controlReCaptcha($response);

        if (!$reCaptcha) {
            wp_die(sprintf('<strong>%s</strong>:&nbsp;%s', __('Error', 'municipio'), __('reCaptcha verification failed', 'municipio')));
        }

        return;
    }
public function validateReCaptcha()
    {
        if (is_user_logged_in()) {
            return;
        }

        $response = isset($_POST['g-recaptcha-response']) ? esc_attr($_POST['g-recaptcha-response']) : '';
        $reCaptcha = \Municipio\Helper\ReCaptcha::controlReCaptcha($response);

        if (!$reCaptcha) {
            wp_die(sprintf('<strong>%s</strong>:&nbsp;%s', __('Error', 'municipio'), __('reCaptcha verification failed', 'municipio')));
        }

        return;
    }
public function validateReCaptcha ( ) { if ( is_user_logged_in ( ) ) { return ; } $ response = isset ( $ _POST [ 'g-recaptcha-response' ] ) ? esc_attr ( $ _POST [ 'g-recaptcha-response' ] ) : '' ; $ reCaptcha = \ Municipio \ Helper \ ReCaptcha :: controlReCaptcha ( $ response ) ; if ( ! $ reCaptcha ) { wp_die ( sprintf ( '<strong>%s</strong>:&nbsp;%s' , __ ( 'Error' , 'municipio' ) , __ ( 'reCaptcha verification failed' , 'municipio' ) ) ) ; } return ; }
Check reCaptcha before comment is saved to post
@return void
Check reCaptcha before comment is saved to post