PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.0
Wp Social Login and Register Social Counter v2.2.0
3.2.1 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 / share / share-html.php
wp-social / template / share Last commit date
primary_content.php 3 years ago share-html.php 3 years ago
share-html.php
143 lines
1 <?php
2
3 use WP_Social\App\Settings;
4
5 defined('ABSPATH') || exit;
6
7 $share_settings = Settings::instance()->get_providers_settings_share();
8 $wanted_providers = $provider;
9 $selected_share_style = $shareStyleKey;
10
11 $uri_hash = md5($currentUrl);
12
13
14 if(!empty($wanted_providers) && is_array($wanted_providers)) :
15
16 if(!empty($styles[$selected_share_style]['package']) && $styles[$selected_share_style]['package'] == 'pro' && !WP_Social::is_pro_active()) {
17
18 ?>
19 <div class="xs_social_share_widget xs_share_url">
20 <ul>
21 <li class="xs-share-li wslu-no-extra-data">Pro plugin deactivated or invalid</li>
22 </ul>
23 </div>
24 <?php
25
26 return;
27 } ?>
28
29 <div class="xs_social_share_widget xs_share_url <?php echo esc_attr($customClass) . ' '; ?>
30 <?php echo esc_attr($fixed_display) . ' '; ?> <?php echo esc_attr($widget_style); ?>">
31
32 <?php if($showCountMarkup): ?>
33
34 <div class="wslu-share-count">
35 <span class="wslu-share-count--total"><?php echo esc_html(xs_format_num($totalSCount)); ?></span>
36 <span class="wslu-share-count--text"><?php esc_html_e('Shares', 'wp-social') ?></span>
37 </div>
38
39 <?php endif; ?>
40
41 <ul>
42 <?php
43 $content = isset($styles[$selected_share_style]['content']) ? $styles[$selected_share_style]['content'] : '';
44
45 foreach($wanted_providers as $key) {
46
47 if(!empty($enabled_providers[$key]['enable'])) {
48
49 $counter = empty($share_counting[$key]['count']) ? 0 : $share_counting[$key]['count'];
50
51 $label = isset($share_settings[$key]['data']['label']) ? $share_settings[$key]['data']['label'] : ucfirst($key);
52 $def = isset($share_settings[$key]['data']['value']) ? intval($share_settings[$key]['data']['value']) : 0;
53 $text = isset($share_settings[$key]['data']['text']) ? $share_settings[$key]['data']['text'] : '';
54
55 $getUrl = isset($core_provider[$key]['url']) ? $core_provider[$key]['url'] : '';
56 $pData = isset($core_provider[$key]['params']) ? $core_provider[$key]['params'] : [];
57
58 $urlCon = empty($core_provider[$key]['params']) ? [] : $core_provider[$key]['params'];
59
60 $old_count = Settings::get_old_count($key);
61 $counter = $counter + $old_count;
62
63 foreach($urlCon as $k => $v) {
64
65 $urlCon[$k] = str_replace(
66 ['[%url%]', '[%title%]', '[%author%]', '[%details%]', '[%source%]', '[%media%]', '[%app_id%]'],
67 [$currentUrl, $title, $author, $details, $source, $media, $app_id],
68 $v
69 );
70 }
71
72 $params = http_build_query($urlCon, '&');
73
74 ?>
75 <li class="xs-share-li <?php echo esc_attr($key); ?>
76 <?php echo esc_attr(Settings::get_extra_data_class($selected_share_style, $styles)) ?>">
77 <a href="javascript:void();"
78 id="xs_feed_<?php echo esc_attr($key) ?>"
79 onclick="xs_social_sharer(this);"
80 data-pid="<?php echo esc_attr($postId) ?>"
81 data-uri_hash="<?php echo esc_attr($uri_hash) ?>"
82 data-key="<?php echo esc_attr($key); ?>"
83 data-xs-href="<?php echo esc_attr($getUrl . '?' . $params); ?>">
84
85 <div class="xs-social-icon">
86 <span class="met-social met-social-<?php echo esc_attr($key); ?>"></span>
87 </div>
88
89 <?php if(!empty($styles[$selected_share_style]['content']) != '') : ?>
90 <div class="wslu-both-counter-text ">
91
92 <?php if(Settings::has_number_content_in_selected_style($selected_share_style, $styles)) : ?>
93 <div class="xs-social-follower">
94 <?php echo esc_html(xs_format_num($counter)); ?>
95 </div>
96 <?php endif; ?>
97
98 <?php if(Settings::has_text_content_in_selected_style($selected_share_style, $styles)) : ?>
99 <div class="xs-social-follower-text">
100 <?php echo esc_html($text); ?>
101 </div>
102 <?php endif; ?>
103
104 <?php if(Settings::has_label_content_in_selected_style($selected_share_style, $styles)) : ?>
105 <div class="xs-social-follower-label">
106 <?php echo esc_html($label); ?>
107 </div>
108 <?php endif; ?>
109 </div>
110 <?php endif; ?>
111
112 <div class="wslu-hover-content">
113 <div class="xs-social-followers">
114 <?php echo esc_html(xs_format_num($counter)); ?>
115 </div>
116 <div class="xs-social-follower-text">
117 <?php echo esc_html($text); ?>
118 </div>
119 <div class="xs-social-follower-label">
120 <?php echo esc_html($label); ?>
121 </div>
122 </div>
123 </a>
124 </li>
125 <?php
126 }
127 } ?>
128 </ul>
129 </div> <?php
130
131 elseif(!empty($styles[$selected_share_style]['package']) && $styles[$selected_share_style]['package'] == 'pro'): ?>
132
133 <div class="xs_social_share_widget xs_share_url">
134 <ul>
135 <li class="xs-share-li wslu-no-extra-data">Pro plugin deactivated</li>
136 </ul>
137 </div>
138
139 <?php
140
141 endif; ?>
142
143