PluginProbe
Social Share Buttons / 1.1.2
Social Share Buttons v1.1.2
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/blocks/twitter_block.php +4 -12 1.15 → 1.1.2 View file →
@@ -23,20 +23,15 @@
23 23 'twitter_handle' => array('default' => ''),
24 24
25 25 );
26 26
27 - static $hooked = null;
28 27
29 28 public function __construct()
30 29 {
31 30 $w = MBSocial()->whistle();
32 31
33 - if (self::$hooked == null) // listen just once.
34 - {
35 - $w->listen('display/vars/twitter_handle', array($this, 'twitter_handle'), 'ask');
36 - $w->listen('display/vars/twitter_hashtags', array($this, 'twitter_hashtags'), 'ask');
37 - self::$hooked = true;
38 - }
32 + $w->listen('display/vars/twitter_handle', array($this, 'twitter_handle'), 'ask');
33 + $w->listen('display/vars/twitter_hashtags', array($this, 'twitter_hashtags'), 'ask');
39 34 }
40 35
41 36 public function twitter_handle()
42 37 {
@@ -66,11 +61,10 @@
66 61 $hash = ( isset($blockdata['twitter_hash'] )) ? $blockdata['twitter_hash'] : false;
67 62
68 63 if ($hash && strlen($hash) > 0)
69 64 {
70 -
71 - $hashes = array_filter(explode(',', trim($hash)) );
72 - $hashes = array_map('trim', $hashes);
65 + $hashes = array_filter(explode('#', $hash) );
66 + $hashes = array_filter($hashes, 'trim');
73 67 $hash = implode(',', $hashes);
74 68 }
75 69 return $hash;
76 70
@@ -142,9 +136,8 @@
142 136 $handle->label = __('Twitter Handle', 'mbsocial');
143 137 $handle->value = $this->getValue('twitter_handle') ;
144 138 $handle->placeholder = '@example';
145 139 $handle->inputclass = 'medium';
146 - $handle->help = __('Adding a handle will include the handle in the proposed message (via)', 'mb-social');
147 140 $admin->addField($handle, 'start', 'end', false);
148 141
149 142
150 143
@@ -153,9 +146,8 @@
153 146 $hash->name = 'twitter_hash';
154 147 $hash->label = __('Twitter Default Hash Tag(s)', 'mbsocial');
155 148 $hash->value = $this->getValue('twitter_hash');
156 149 $hash->inputclass = 'medium';
157 - $hash->help = __('Separate multiple hashtags with a comma (first,second)', 'mb-social');
158 150 $hash->placeholder = '#';
159 151
160 152 $admin->addField($hash, 'start', 'end', false);
161 153