PluginProbe
Social Share Buttons / 1.30
Social Share Buttons v1.30
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-block.php +15 -3 1.31.30 View file →
@@ -77,22 +77,32 @@
77 77 }
78 78
79 79 public function getColorValue($fieldname)
80 80 {
81 - $value = $this->getValue($fieldname);
81 + $value = self::getValue($fieldname);
82 + if ($this->isrgba($value))
83 + return $value;
84 +
82 85 if (! $value )
83 86 return false;
84 -
85 87 if (substr($value,0,1) !== '#')
86 88 {
87 89 $value = '#' . $value;
88 90 }
89 -
90 91 return $value;
92 +}
91 93
94 +private function isrgba($value)
95 +{
96 + if (strpos($value, 'rgb') >= 0 )
97 + return true;
98 + else {
99 + return false;
100 + }
92 101 }
93 102
94 103
104 +
95 105 public function setPreview($preview = true)
96 106 {
97 107 $this->is_preview = $preview;
98 108
@@ -143,9 +153,11 @@
143 153 else
144 154 {
145 155 $default = (isset($options["default"])) ? $options["default"] : '';
146 156 // stripslashes since the WP post var adds them.
157 +
147 158 $blockdata[$field] = (isset($post[$field])) ? stripslashes(sanitize_text_field($post[$field])) : $default;
159 +
148 160 }
149 161 }
150 162
151 163 $data[$this->blockname] = $blockdata;