adding recaptcha to form wiget
This commit is contained in:
@@ -14,6 +14,8 @@ use MailPoet\WP\Hooks;
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
class Widget extends \WP_Widget {
|
||||
const RECAPTCHA_API_SCRIPT = '<script src="https://www.google.com/recaptcha/api.js"></script>';
|
||||
|
||||
private $renderer;
|
||||
|
||||
function __construct() {
|
||||
@@ -50,7 +52,7 @@ class Widget extends \WP_Widget {
|
||||
wp_print_scripts('mailpoet_vendor');
|
||||
wp_print_scripts('mailpoet_public');
|
||||
if(Setting::getValue('re_captcha.enabled')) {
|
||||
echo '<script src="https://www.google.com/recaptcha/api.js"></script>';
|
||||
echo self::RECAPTCHA_API_SCRIPT;
|
||||
}
|
||||
$scripts = ob_get_contents();
|
||||
ob_end_clean();
|
||||
@@ -275,7 +277,9 @@ EOL;
|
||||
|
||||
if(!empty($body)) {
|
||||
$form_id = $this->id_base . '_' . $form['id'];
|
||||
|
||||
if(Setting::getValue('re_captcha.enabled')) {
|
||||
$before_widget .= self::RECAPTCHA_API_SCRIPT;
|
||||
}
|
||||
$data = array(
|
||||
'form_id' => $form_id,
|
||||
'form_type' => $form_type,
|
||||
|
Reference in New Issue
Block a user