PluginProbe
Loginizer / trunk
Loginizer vtrunk
2.1.0 2.0.9 2.0.8 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 All 74 releases
← All changes | functions.php +18 -3 2.0.9 → trunk View file →
@@ -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);