芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/public_html/wp-content/plugins/metform/widgets/recaptcha/recaptcha.php
start_controls_section( 'content_section', [ 'label' => esc_html__( 'Content', 'metform' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'mf_recaptcha_notice_info', [ 'label' => esc_html__( 'reCAPTCHA configure: ', 'metform' ), 'type' => Controls_Manager::RAW_HTML, 'raw' => \MetForm\Utils\Util::kses( 'Turn on recaptcha from form setting.
Then you have to must configure recaptcha site and secret key from MetForm -> Settings
from here.
See Documentation.
', 'metform-pro' ), 'content_classes' => 'mf-input-map-api-notice', ] ); $this->add_control( 'mf_recaptcha_class_name', [ 'label' => esc_html__( 'Add Extra Class Name : ', 'metform' ), 'type' => Controls_Manager::TEXT, ] ); $this->end_controls_section(); $this->start_controls_section( 'style_section', [ 'label' => esc_html__( 'Label', 'metform' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'mf_input_warning_text_color', [ 'label' => esc_html__( 'Warning Text Color:', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'default' => '#f00', 'selectors' => [ '{{WRAPPER}} .mf-error-message' => 'color: {{VALUE}}' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_warning_text_typography', 'label' => esc_html__( 'Warning Text Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .mf-error-message', ] ); $this->end_controls_section(); $this->insert_pro_message(); } protected function render($instance = []){ $settings = $this->get_settings_for_display(); extract($settings); $render_on_editor = false; $is_edit_mode = 'metform-form' === get_post_type() && \Elementor\Plugin::$instance->editor->is_edit_mode(); $configData = [ 'message' => $errorMessage = isset($mf_input_validation_warning_message) ? !empty($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : __("reCAPTCHA is required.", 'metform') : __("reCAPTCHA is required.", 'metform'), 'required' => true, ]; $recaptcha_setting = \MetForm\Core\Admin\Base::instance()->get_settings_option(); $recaptcha_key_v2 = isset($recaptcha_setting['mf_recaptcha_site_key']) ? $recaptcha_setting['mf_recaptcha_site_key'] : '' ; $recaptcha_key_v3 = isset($recaptcha_setting['mf_recaptcha_site_key_v3']) ? $recaptcha_setting['mf_recaptcha_site_key_v3'] : ''; $mf_recaptcha_type = ((isset($recaptcha_setting['mf_recaptcha_version']) && ($recaptcha_setting['mf_recaptcha_version'] != '')) ? $recaptcha_setting['mf_recaptcha_version'] : 'recaptcha-v2'); ?>
data-callback="handleReCAPTCHA_${this.state.recaptcha_uid}" data-expired-callback="handleReCAPTCHA_${this.state.recaptcha_uid}" data-error-callback="handleReCAPTCHA_${this.state.recaptcha_uid}" aria-invalid=${validation.errors['g-recaptcha-response'] ? 'true' : 'false'} >
parent.activateValidation(, el)} /> <${validation.ErrorMessage} errors=${validation.errors} name="g-recaptcha-response" as=${html`
`} />
', ' async defer>', $tag ); }, 20, 2 ); // wp_enqueue_script('recaptcha-v2'); } if($mf_recaptcha_type == 'recaptcha-v3'){ ?>
editor->is_edit_mode()){ echo "
".esc_html__('reCAPTCHA will be shown on preview.', 'metform')."
"; } wp_enqueue_script('recaptcha-v3'); } ?>