PluginProbe
Social Share Buttons / 1.5
Social Share Buttons v1.5
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | classes/class-network.php +4 -41 1.161.5 View file →
@@ -14,10 +14,8 @@
14 14 protected $countable = false; // If network supports count of likes / shares / favs
15 15 protected $count_api = ''; // API URL for requesting counts
16 16 protected $count_check_time = 14400; // (PHP 5.3) 4 * HOUR_IN_SECONDS; // Transient time, how often to check network for new counts
17 17 protected $share_url = null; // URL to link to when sharing something
18 - protected $alternate_url = null; // if another URL needs to be
19 - protected $alternate_label = null; // Label for the other option (checkbox)
20 18 protected $is_popup = true; // Open in Popup or not
21 19 protected $popup_dimensions = array(400,300); // Default popup dimensions
22 20 protected $return_var; // Count API return var ( JSON format )
23 21
@@ -35,12 +33,8 @@
35 33 protected $label; // Label (default) Text. This will be in the button, e.g. on hover
36 34
37 35 protected $icon_type = 'fab'; // Icon library set
38 36 protected $icon = 'fa-circle'; // Icon
39 - protected $icon_image_id; // for svg type icons.
40 - protected $icon_image_url;
41 - protected $icon_image_size;
42 -// protected $icon_image_alt = '';
43 37
44 38 protected $color = '#fff';
45 39
46 40 // extra options [internal]
@@ -49,18 +43,12 @@
49 43 protected $is_active = true;
50 44 protected $is_limitedpro = false; // the network is only intended for MB PRO
51 45 protected $forcesamewindow = false; // never open this in a new window / i.e. email / print type networks
52 46
53 - protected $default_options = null;
54 -
55 47 public function __construct()
56 48 {
57 - if (is_null($this->profile_placeholder))
58 - $this->profile_placeholder = __('User Name','mbsocial');
59 - if (is_null($this->profile_label))
60 - $this->profile_label = __('Follow', 'mbsocial');
61 -
62 - $this->default_options = $this->get_all_options(); // init them as default. For save function
49 + $this->profile_placeholder = __('User Name','mbsocial');
50 + $this->profile_label = __('Follow', 'mbsocial');
63 51 }
64 52
65 53 public function get($name)
66 54 {
@@ -74,12 +62,8 @@
74 62 {
75 63 $popup_width = isset($this->popup_dimensions[0]) ? $this->popup_dimensions[0] : 0;
76 64 $popup_height = isset($this->popup_dimensions[1]) ? $this->popup_dimensions[1] : 0;
77 65
78 -
79 - // iterate on this next time perhaps.
80 - //$attrs = get_object_vars($this);
81 -
82 66 $options = array(
83 67 'active' => $this->is_active, // no nw setting for this
84 68 'popup' => $this->is_popup,
85 69 'label' => $this->label,
@@ -88,25 +72,16 @@
88 72 'popup_width' => $popup_width,
89 73 'popup_height' => $popup_height,
90 74 'icon_type' => $this->icon_type,
91 75 'icon' => $this->icon,
92 - 'icon_image_id' => $this->icon_image_id,
93 - 'icon_image_url' => $this->icon_image_url,
94 - // 'icon_image_alt' => $this->icon_image_alt,
95 - 'icon_image_size' => $this->icon_image_size,
96 76 'color' => $this->color,
97 77 'displayMobile' => $this->displayMobile,
98 - 'displayDesktop' => $this->displayDesktop,
78 + 'displayDesktop' => $this->displayDesktop,
99 79 );
100 80
101 81 return $options;
102 82 }
103 83
104 - public function get_all_defaults()
105 - {
106 - return $this->default_options;
107 - }
108 -
109 84 public function load_settings($settings)
110 85 {
111 86 if (! $settings)
112 87 return;
@@ -178,16 +153,8 @@
178 153
179 154 return true;
180 155 }
181 156
182 - public function has_alternate()
183 - {
184 - if (is_null($this->alternate_url))
185 - return false;
186 -
187 - return true;
188 - }
189 -
190 157 /** Use this function to check if popup link should be used **/
191 158 public function is_popup()
192 159 {
193 160 $use_profile = MBSocial()->whistle()->ask('editor/profile/use');
@@ -235,16 +202,12 @@
235 202 }
236 203 elseif ($is_profile && $is_share)
237 204 {
238 205 $use_profile = MBSocial()->whistle()->ask('editor/profile/use');
239 - $use_alternate = MBSocial()->whistle()->ask('editor/profile/alternate');
240 206
241 207 if ($use_profile == 1)
242 208 {
243 - if ($use_alternate == 1)
244 - return $this->alternate_url;
245 - else
246 - return $this->profile_url;
209 + return $this->profile_url;
247 210 }
248 211 else {
249 212 return $this->share_url;
250 213 }