Skip to content

Commit

Permalink
Merge pull request #27 from wpdev10/master
Browse files Browse the repository at this point in the history
Fix recaptcha not working on login widget on pages other than UWP pages
  • Loading branch information
wpdev10 authored May 30, 2019
2 parents 0e7b1bd + fae4202 commit 806b526
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,47 +54,47 @@ function uwp_recaptcha_addons_get_settings( $settings, $current_section ) {
array(
'id' => 'enable_recaptcha_in_register_form',
'name' => __( 'Enable ReCaptcha in', 'uwp-recaptcha' ),
'desc' => __( 'UsersWP Register Form.', 'uwp-recaptcha' ),
'desc' => __( 'UsersWP Register Form', 'uwp-recaptcha' ),
'type' => 'checkbox',
'default' => '1',
'class' => 'uwp_label_inline',
),
array(
'id' => 'enable_recaptcha_in_login_form',
'name' => '',
'desc' => __( 'UsersWP Login Form.', 'uwp-recaptcha' ),
'desc' => __( 'UsersWP Login Form', 'uwp-recaptcha' ),
'type' => 'checkbox',
'default' => '1',
'class' => 'uwp_label_inline',
),
array(
'id' => 'enable_recaptcha_in_forgot_form',
'name' => '',
'desc' => __( 'UsersWP Forgot Form.', 'uwp-recaptcha' ),
'desc' => __( 'UsersWP Forgot Form', 'uwp-recaptcha' ),
'type' => 'checkbox',
'default' => '1',
'class' => 'uwp_label_inline',
),
array(
'id' => 'enable_recaptcha_in_account_form',
'name' => '',
'desc' => __( 'UsersWP Account Form.', 'uwp-recaptcha' ),
'desc' => __( 'UsersWP Account Form', 'uwp-recaptcha' ),
'type' => 'checkbox',
'default' => '1',
'class' => 'uwp_label_inline',
),
array(
'id' => 'enable_recaptcha_in_wp_login_form',
'name' => '',
'desc' => __( 'WP Login Form.', 'uwp-recaptcha' ),
'desc' => __( 'WordPress Login Form', 'uwp-recaptcha' ),
'type' => 'checkbox',
'default' => '1',
'class' => 'uwp_label_inline',
),
array(
'id' => 'enable_recaptcha_in_wp_register_form',
'name' => '',
'desc' => __( 'WP Register Form.', 'uwp-recaptcha' ),
'desc' => __( 'WordPress Registeration Form', 'uwp-recaptcha' ),
'type' => 'checkbox',
'default' => '1',
'class' => 'uwp_label_inline',
Expand Down
8 changes: 3 additions & 5 deletions includes/class-uwp-recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,11 @@ public function admin_enqueue_scripts(){
public function enqueue_scripts()
{
if (!wp_script_is('uwp_recaptcha_js_api', 'registered')) {
if ($GLOBALS['pagenow'] === 'wp-login.php' || is_uwp_page() || is_uwp_page('frontend_post_page')) {
$language = uwp_recaptcha_language();
$language = uwp_recaptcha_language();

wp_register_script('uwp_recaptcha_js_api', 'https://www.google.com/recaptcha/api.js?onload=uwp_recaptcha_onload&hl=' . $language . '&render=explicit', array('jquery'), $this->version, true);
wp_register_script('uwp_recaptcha_js_api', 'https://www.google.com/recaptcha/api.js?onload=uwp_recaptcha_onload&hl=' . $language . '&render=explicit', array('jquery'), $this->version, true);

add_action('wp_footer', array($this, 'add_scripts'));
}
add_action('wp_footer', array($this, 'add_scripts'));
}
}

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ TBA

== Changelog ==

= 1.0.5 =
* Recaptcha not working on login widget on pages other than UWP pages - FIXED

= 1.0.4 =
* Integrate new settings interface - CHANGED
* Recaptcha size compact for mobile compatibility - ADDED
Expand Down

0 comments on commit 806b526

Please sign in to comment.