PluginProbe ʕ •ᴥ•ʔ
Nextend Social Login and Register / trunk
Nextend Social Login and Register vtrunk
trunk 1.0 1.1 1.2 1.4 1.4.9 1.6.0 2.0.2 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.27 3.0.28 3.0.29 3.0.3 3.0.4 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.21 3.1.22 3.1.23 3.1.25 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9
nextend-facebook-connect / widget.php
nextend-facebook-connect Last commit date
NSL 2 years ago admin 2 months ago includes 4 months ago js 1 year ago languages 4 months ago providers 4 months ago template-parts 11 months ago class-settings.php 6 years ago compat.php 6 years ago index.html 13 years ago licence.txt 6 years ago nextend-facebook-connect.php 2 months ago nextend-social-login.php 2 months ago readme.txt 2 months ago widget.php 6 years ago
widget.php
125 lines
1 <?php
2
3 class Nextend_Social_Login_Widget extends WP_Widget {
4
5 public static function register() {
6 register_widget('Nextend_Social_Login_Widget');
7 }
8
9 public function __construct() {
10 parent::__construct('nextend_social_login', sprintf(__('%s Buttons', 'nextend-facebook-connect'), 'Nextend Social Login'));
11 }
12
13 public function form($instance) {
14 $instance = wp_parse_args((array)$instance, array('title' => ''));
15 $title = $instance['title'];
16
17 $style = isset($instance['style']) ? $instance['style'] : 'default';
18
19 $align = isset($instance['align']) ? $instance['align'] : 'left';
20
21 $loginButtons = isset($instance['login-buttons']) ? !!intval($instance['login-buttons']) : true;
22
23 $linkButtons = isset($instance['link-buttons']) ? !!intval($instance['link-buttons']) : false;
24
25 $unlinkButtons = isset($instance['unlink-buttons']) ? !!intval($instance['unlink-buttons']) : false;
26
27 $isPRO = apply_filters('nsl-pro', false);
28
29 ?>
30 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?>
31 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
32 name="<?php echo $this->get_field_name('title'); ?>" type="text"
33 value="<?php echo esc_attr($title); ?>"/></label></p>
34
35 <?php if ($isPRO): ?>
36
37 <p>
38 <label for="<?php echo $this->get_field_id('style'); ?>"><?php _e('Button style:', 'nextend-facebook-connect'); ?></label><br>
39 <input class="widefat" id="<?php echo $this->get_field_id('style_default'); ?>"
40 name="<?php echo $this->get_field_name('style'); ?>" type="radio" value="default"
41 <?php if ($style == 'default'): ?>checked<?php endif; ?>/>
42 <label for="<?php echo $this->get_field_id('style_default'); ?>"><?php _e('Default', 'nextend-facebook-connect'); ?></label>
43 <br>
44 <input class="widefat" id="<?php echo $this->get_field_id('style_icon'); ?>"
45 name="<?php echo $this->get_field_name('style'); ?>" type="radio" value="icon"
46 <?php if ($style == 'icon'): ?>checked<?php endif; ?>/>
47 <label for="<?php echo $this->get_field_id('style_icon'); ?>"><?php _e('Icon', 'nextend-facebook-connect'); ?></label>
48 <br>
49 </p>
50 <?php endif; ?>
51
52 <p>
53 <label for="<?php echo $this->get_field_id('align'); ?>"><?php _e('Button align:', 'nextend-facebook-connect'); ?></label><br>
54 <input class="widefat" id="<?php echo $this->get_field_id('align_left'); ?>"
55 name="<?php echo $this->get_field_name('align'); ?>" type="radio" value="left"
56 <?php if ($align == 'left'): ?>checked<?php endif; ?>/>
57 <label for="<?php echo $this->get_field_id('align_left'); ?>"><?php _e('Left', 'nextend-facebook-connect'); ?></label>
58 <br>
59 <input class="widefat" id="<?php echo $this->get_field_id('align_center'); ?>"
60 name="<?php echo $this->get_field_name('align'); ?>" type="radio" value="center"
61 <?php if ($align == 'center'): ?>checked<?php endif; ?>/>
62 <label for="<?php echo $this->get_field_id('align_center'); ?>"><?php _e('Center', 'nextend-facebook-connect'); ?></label>
63 <br>
64 <input class="widefat" id="<?php echo $this->get_field_id('align_right'); ?>"
65 name="<?php echo $this->get_field_name('align'); ?>" type="radio" value="right"
66 <?php if ($align == 'right'): ?>checked<?php endif; ?>/>
67 <label for="<?php echo $this->get_field_id('align_right'); ?>"><?php _e('Right', 'nextend-facebook-connect'); ?></label>
68 <br>
69 </p>
70
71 <p>
72 <input name="<?php echo $this->get_field_name('login-buttons'); ?>" type="hidden" value="0"/>
73 <input id="<?php echo $this->get_field_id('login-buttons'); ?>"
74 name="<?php echo $this->get_field_name('login-buttons'); ?>" type="checkbox" value="1"
75 <?php if ($loginButtons): ?>checked<?php endif; ?>/>
76 <label for="<?php echo $this->get_field_id('login-buttons'); ?>"><?php _e('Show login buttons', 'nextend-facebook-connect'); ?></label>
77
78 </p>
79
80 <p>
81 <input name="<?php echo $this->get_field_name('link-buttons'); ?>" type="hidden" value="0"/>
82 <input id="<?php echo $this->get_field_id('link-buttons'); ?>"
83 name="<?php echo $this->get_field_name('link-buttons'); ?>" type="checkbox" value="1"
84 <?php if ($linkButtons): ?>checked<?php endif; ?>/>
85 <label for="<?php echo $this->get_field_id('link-buttons'); ?>"><?php _e('Show link buttons', 'nextend-facebook-connect'); ?></label>
86
87 </p>
88
89 <p>
90 <input name="<?php echo $this->get_field_name('unlink-buttons'); ?>" type="hidden" value="0"/>
91 <input id="<?php echo $this->get_field_id('unlink-buttons'); ?>"
92 name="<?php echo $this->get_field_name('unlink-buttons'); ?>" type="checkbox" value="1"
93 <?php if ($unlinkButtons): ?>checked<?php endif; ?>/>
94 <label for="<?php echo $this->get_field_id('unlink-buttons'); ?>"><?php _e('Show unlink buttons', 'nextend-facebook-connect'); ?></label>
95
96 </p>
97 <?php
98 }
99
100 public function widget($args, $instance) {
101 $title = !empty($instance['title']) ? $instance['title'] : '';
102
103 $title = apply_filters('widget_title', $title, $instance, $this->id_base);
104
105 $style = !empty($instance['style']) ? $instance['style'] : 'default';
106
107 $align = !empty($instance['align']) ? $instance['align'] : 'left';
108
109 $loginButtons = isset($instance['login-buttons']) ? intval($instance['login-buttons']) : 1;
110 $linkButtons = isset($instance['link-buttons']) ? intval($instance['link-buttons']) : 0;
111 $unlinkButtons = isset($instance['unlink-buttons']) ? intval($instance['unlink-buttons']) : 0;
112
113 echo $args['before_widget'];
114 if ($title) {
115 echo $args['before_title'] . $title . $args['after_title'];
116 }
117
118 echo do_shortcode('[nextend_social_login style="' . $style . '" login="' . $loginButtons . '" link="' . $linkButtons . '" unlink="' . $unlinkButtons . '" align="' . $align . '"]');
119
120 echo $args['after_widget'];
121 }
122 }
123
124 add_action('widgets_init', 'Nextend_Social_Login_Widget::register');
125