| @@ -457,14 +457,21 @@ | ||
| 457 | 457 | ]; |
| 458 | 458 | |
| 459 | 459 | $social_buttons = '<div id="lz-social-login-btns" class="'.($style == 'icon' ? 'lz-social-login-btns-icon' : 'lz-social-login-btns-full').' '.($position == 'above' || $position == 'below' ? 'lz-social-'.$padding[$position].'-padding' : '').'" style="justify-self:'.esc_attr($container_alignment).'; justify-content:'.esc_attr($button_alignment).';">'; |
| 460 | 460 | |
| 461 | + /* translators: %s: This OR is used as a separator for Either login through username OR use social login */ | |
| 462 | + $or_translated = __('OR', 'loginizer'); | |
| 463 | + | |
| 461 | 464 | // HTML of the divider in case the buttons are below the login fields |
| 462 | 465 | if(!empty($divider_pos) && $divider_pos == 'above'){ |
| 463 | - $social_buttons .= '<div class="loginizer-social-divider">OR</div><br>'; | |
| 466 | + $social_buttons .= '<div class="loginizer-social-divider">'.esc_html($or_translated).'</div><br>'; | |
| 464 | 467 | } |
| 465 | 468 | |
| 466 | 469 | include_once LOGINIZER_DIR . '/main/login-providers.php'; |
| 470 | + | |
| 471 | + // This is used to decide weather we will use Login with or Register with | |
| 472 | + $current_hook = current_action(); | |
| 473 | + $register_hooks = ['register_form', 'woocommerce_register_form']; | |
| 467 | 474 | |
| 468 | 475 | foreach($providers as $provider => $settings){ |
| 469 | 476 | if(empty($settings['enabled']) || empty($settings['tested'])){ |
| 470 | 477 | continue; |
| @@ -496,12 +503,20 @@ | ||
| 496 | 503 | $social_buttons .= '<div class="loginizer-social-button '.($style == 'icon' ? 'lz-social-button-icon' : 'lz-social-button-btn').' '.($shape == 'circle' ? 'lz-social-button-icon-circle' : 'lz-social-button-icon-square').'" onclick="loginizer_auth_popup(\''.esc_js($provider).'\', '.esc_js(!empty($settings['loginizer_social_key']) ? true : 0).')" style="'.((!empty($loginizer_login_providers[$provider]['styles']) && !empty($loginizer_login_providers[$provider]['styles'][$btn_style])) ? esc_attr($loginizer_login_providers[$provider]['styles'][$btn_style]) : esc_attr('background-color:'. esc_attr($color)). '; color:#FFF;') .'"> |
| 497 | 504 | <div class="loginizer-social-btn-logo"> |
| 498 | 505 | <img src="'.esc_url($img_url).'" height="24" alt="'.esc_attr($name).' Icon"/> |
| 499 | 506 | </div>'; |
| 507 | + | |
| 508 | + if(in_array($current_hook, $register_hooks)){ | |
| 509 | + /* translators: %s: This is for social login so the complete text would be Register With [Brand Name], eg Register With Google */ | |
| 510 | + $button_text = esc_html__('Register With', 'loginizer'); | |
| 511 | + } else { | |
| 512 | + /* translators: %s: This is for social login so the complete text would be Login With [Brand Name], eg Login With Google */ | |
| 513 | + $button_text = esc_html__('Login With', 'loginizer'); | |
| 514 | + } | |
| 500 | 515 | |
| 501 | 516 | // Button text in case of full button |
| 502 | 517 | if(!empty($loginizer['social_settings']) && $style === 'full'){ |
| 503 | - $social_buttons .= '<div class="loginizer-social-btn-text">'.esc_html__('Login With', 'loginizer').' <strong>'.esc_html($name).'</strong> | |
| 518 | + $social_buttons .= '<div class="loginizer-social-btn-text">'.esc_html($button_text).' <strong>'.esc_html($name).'</strong> | |
| 504 | 519 | </div>'; |
| 505 | 520 | } |
| 506 | 521 | |
| 507 | 522 | $social_buttons .= '</div>'; |
| @@ -512,9 +527,9 @@ | ||
| 512 | 527 | } |
| 513 | 528 | |
| 514 | 529 | // HTML of the divider in case the buttons are above the login fields |
| 515 | 530 | if(!empty($divider_pos) && $divider_pos == 'below'){ |
| 516 | - $social_buttons .= '<br><div class="loginizer-social-divider">OR</div>'; | |
| 531 | + $social_buttons .= '<br><div class="loginizer-social-divider">'.esc_html($or_translated).'</div>'; | |
| 517 | 532 | } |
| 518 | 533 | |
| 519 | 534 | $social_buttons .= '</div>'; |
| 520 | 535 | loginizer_add_social_js($page_type); |
| @@ -640,9 +655,11 @@ | ||
| 640 | 655 | |
| 641 | 656 | } |
| 642 | 657 | |
| 643 | 658 | function loginizer_social_btn_login($return = false, $id = ''){ |
| 644 | - loginizer_social_btn($return, 'login'); | |
| 659 | + if(!loginizer_is_blacklisted()){ | |
| 660 | + loginizer_social_btn($return, 'login'); | |
| 661 | + } | |
| 645 | 662 | } |
| 646 | 663 | |
| 647 | 664 | function loginizer_get_social_error(){ |
| 648 | 665 | global $loginizer; |
| @@ -669,5 +686,5 @@ | ||
| 669 | 686 | |
| 670 | 687 | // Cleaning the error data |
| 671 | 688 | delete_site_transient($error_identifier); // Deleting the data |
| 672 | 689 | //setcookie('lz_social_error', '', time() - 300, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true); // have to delete |
| 673 | -} | |
| 690 | +} | |