PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.4
Wp Social Login and Register Social Counter v2.2.4
trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / template / login / login-btn-html.php
wp-social / template / login Last commit date
screens 3 years ago login-btn-html.php 3 years ago
login-btn-html.php
93 lines
1 <?php
2
3 use WP_Social\Lib\Login\Line_App;
4
5 defined('ABSPATH') || exit;
6
7 // $buttonStyle is the styles selected by user example: style-1 || style-2 || style-3
8 $currentStyle = empty($force_style) ? (isset($style_data['login_button_style']) ? $style_data['login_button_style'] : 'style-1') : $force_style;
9
10 // parent class of login button container
11 $className = 'xs-login xs-login--' . $currentStyle;
12 ?>
13 <div id="xs-social-login-container">
14 <div class="<?php echo esc_attr($className); ?>">
15 <?php
16
17 if(!is_user_logged_in()) {
18
19 $url_params = '';
20
21 if(empty($_GET['redirect_to'])) {
22
23 $custom_url = xs_current_url_custom();
24
25 if(strlen($custom_url) > 2) {
26 if($typeCurrent == 'show') {
27 $url_params = '?XScurrentPage=' . $custom_url;
28 }
29 }
30
31 } else {
32
33 $url_params = '?redirect_to=' . urlencode(urldecode($_GET['redirect_to']));
34 }
35
36 $core_provider = \WP_Social\App\Providers::get_core_providers_login();
37 $enabled_providers = \WP_Social\App\Settings::get_enabled_provider_conf_login();
38
39 /**
40 * todo - below there are some bujruki code need to change it, style icon set info also should come from array
41 *
42 */
43
44 // loop through all the provides
45 foreach($core_provider AS $keyType => $valueType):
46 // check if the provider enable
47 if(!empty($enabled_providers[$keyType]['enable'])):
48
49 if(in_array('all', $attr_provider) || in_array($keyType, $attr_provider)) {
50
51 /*
52 ------------------------------------------
53 arrange necessary info for all buttons
54 ----------------------------------------
55 */
56 $args = [
57 'label' => isset($provider_data[$keyType]['login_label']) ? $provider_data[$keyType]['login_label'] : 'Login with <b>' . $valueType . '</b>',
58 'icon' => '<i class="met-social met-social-' . $keyType . '"></i>',
59 'clrClass' => 'wslu-color-scheme--' . $keyType,
60 ];
61
62
63 if($valueType == 'LineApp') {
64 $line = new Line_App();
65 $args['url'] = $line->get_auth_url(get_site_url() . '/wp-json/wslu-social-login/type/' . $keyType);
66
67 } else {
68 $args['url'] = get_site_url() . '/wp-json/wslu-social-login/type/' . $keyType . '' . $url_params;
69 }
70
71 /*
72 -------------------------------------------------------
73 -require a specific markup file that contain the style
74 -markup file name and style key must be same
75 ------------------------------------------------------
76 */
77 $style_file_path = WSLU_LOGIN_PLUGIN . '/template/login/screens/default.php';
78
79 require($style_file_path);
80 }
81 endif;
82 endforeach;
83 } else {
84 $correntUrlLogout = esc_url(xs_current_url_custom());
85 ?>
86 <div><a class="wslu-logout-button"
87 rel="nofollow"
88 href="<?php echo esc_url(wp_logout_url($correntUrlLogout)); ?>"><?php echo esc_html__('Logout', 'wp-social'); ?></a>
89 </div> <?php
90 } ?>
91 </div>
92 </div>
93