options = get_option('cwginstocksettings'); $check_is_enable = isset($options['enable_recaptcha']) && $options['enable_recaptcha'] == '1' ? '1' : '2'; if ($check_is_enable == '1') { add_action('cwg_instock_after_email_field', array($this, 'add_recaptcha_to_subscribe_form'), 10, 2); add_filter('cwgstock_submit_attr', array($this, 'disable_attr_on_recaptcha'), 10, 3); add_action('wp_enqueue_scripts', array($this, 'enqueue_script'), 999); } add_action('cwginstock_register_settings', array($this, 'add_settings_field')); add_filter('cwginstock_localization_array', array($this, 'add_localize_data')); } public function add_recaptcha_to_subscribe_form($product_id, $variation_id) { $variation_id = intval($variation_id); $options = $this->options; if ($variation_id > 0) { ?>
" . __('Check this for more information about google reCAPTCHA') . ""; $captcha_heading = __("Add Google reCAPTCHA to the Subscribe Form", 'cwginstocknotifier'); echo $captcha_heading . " " . $url; } public function enable_recaptcha() { $options = get_option('cwginstocksettings'); ?> value="1"/>value="1"/>
'/> '/>