Commit ad4c4453 authored by Kevin Stover's avatar Kevin Stover Committed by GitHub

Adding a label setting to the recaptcha field. Closes #2099. (#2138)

parent 2eaf52dd
......@@ -17,6 +17,8 @@ class NF_Fields_Recaptcha extends NF_Abstracts_Field
protected $_test_value = '';
protected $_settings = array( 'label' );
public function __construct()
{
parent::__construct();
......@@ -27,7 +29,7 @@ class NF_Fields_Recaptcha extends NF_Abstracts_Field
'name' => 'wrapper_class',
'type' => 'textbox',
'placeholder' => '',
'label' => __( 'Wrapper', 'ninja-forms' ),
'label' => __( 'Wrapper Class', 'ninja-forms' ),
'width' => 'full',
'value' => '',
'group' => 'primary',
......@@ -36,8 +38,6 @@ class NF_Fields_Recaptcha extends NF_Abstracts_Field
);
add_filter( 'nf_sub_hidden_field_types', array( $this, 'hide_field_type' ) );
// add_filter( 'script_loader_tag', array( $this, 'add_script_attributes' ), 10, 2);
}
public function localize_settings( $settings, $form ) {
......@@ -75,10 +75,4 @@ class NF_Fields_Recaptcha extends NF_Abstracts_Field
$field_types[] = $this->_name;
return $field_types;
}
function add_script_attributes( $tag, $handle )
{
if ( 'google-recaptcha' !== $handle ) return $tag;
return str_replace( ' src', ' async="async" defer="defer" src', $tag );
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment