PluginProbe
Phone Button / trunk
Phone Button vtrunk
trunk 1.0.0 1.0.1 1.0.3 1.1.0 1.1.1 2.0.0 2.1.0 2.1.1 2.1.2
← All changes | include/admin-output.php +47 -17 1.1.0trunk View file →
@@ -48,8 +48,11 @@
48 48 $mobile_horizontal_spacing = sanitize_text_field( $_POST['mobile_horizontal_spacing'] );
49 49 $mobile_vertical_position = sanitize_text_field( $_POST['mobile_vertical_position'] );
50 50 $mobile_vertical_spacing = sanitize_text_field( $_POST['mobile_vertical_spacing'] );
51 51
52 + $exclude_option = sanitize_text_field( $_POST['exclude_option'] );
53 + $exclude_ids = sanitize_text_field( $_POST['exclude_ids'] );
54 +
52 55 // ----------------------------------------------
53 56 // insert the data into an array
54 57 // ----------------------------------------------
55 58
@@ -75,8 +78,11 @@
75 78 'mobile_horizontal_position' => $mobile_horizontal_position,
76 79 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
77 80 'mobile_vertical_position' => $mobile_vertical_position,
78 81 'mobile_vertical_spacing' => $mobile_vertical_spacing,
82 +
83 + 'exclude_option' => $exclude_option,
84 + 'exclude_ids' => $exclude_ids,
79 85 ); // $creating_data_array = array(
80 86
81 87 // ----------------------------------------------
82 88 // creating a value with all the array data
@@ -94,9 +100,9 @@
94 100 // inserting all the data to datbase
95 101 // ----------------------------------------------
96 102
97 103 $plugin_data = $array_key_name . "***" . $array_item_value;
98 - $plugin_data = yydev_phone_btn_mysql_prep($plugin_data);
104 + $plugin_data = sanitize_text_field($plugin_data);
99 105
100 106 // update optuon on the database into wp_options
101 107 update_option($wp_options_name, $plugin_data);
102 108
@@ -160,25 +166,25 @@
160 166 </div><!--yydev_phone_btn_line-->
161 167
162 168 <div class="yydev_phone_btn_line">
163 169 <label for="phone_number">Phone Number: </label>
164 - <input type="text" id="phone_number" class="input-short" name="phone_number" value="<?php echo $plugin_data_array['phone_number']; ?>" />
170 + <input type="text" id="phone_number" class="input-short" name="phone_number" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['phone_number']); ?>" />
165 171 <small>Example: 0999999999</small>
166 172 </div><!--yydev_phone_btn_line-->
167 173
168 174 <div class="yydev_phone_btn_line">
169 175 <label for="button_width">Button Width: </label>
170 - <input type="text" id="button_width" class="input-very-short" name="button_width" value="<?php echo $plugin_data_array['button_width']; ?>" /> PX
176 + <input type="text" id="button_width" class="input-very-short" name="button_width" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['button_width']); ?>" /> PX
171 177 </div><!--yydev_phone_btn_line-->
172 178
173 179 <div class="yydev_phone_btn_line">
174 180 <label for="button_height">Button Height: </label>
175 - <input type="text" id="button_height" class="input-very-short" name="button_height" value="<?php echo $plugin_data_array['button_height']; ?>" /> PX
181 + <input type="text" id="button_height" class="input-very-short" name="button_height" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['button_height']); ?>" /> PX
176 182 </div><!--yydev_phone_btn_line-->
177 183
178 184 <div class="yydev_phone_btn_line">
179 185 <label for="border_radius">Border Radius (Button Roundness): </label>
180 - <input type="text" id="border_radius" class="input-very-short" name="border_radius" value="<?php echo $plugin_data_array['border_radius']; ?>" />
186 + <input type="text" id="border_radius" class="input-very-short" name="border_radius" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['border_radius']); ?>" />
181 187 <small>Examples: 10px, 50%</small>
182 188 </div><!--yydev_phone_btn_line-->
183 189
184 190 <div class="yydev_phone_btn_line">
@@ -189,9 +195,9 @@
189 195 <option value="right" <?php if ($plugin_data_array['horizontal_position'] == "right") {echo "selected";} ?> >Right</option>
190 196 </select>
191 197
192 198 <label for="horizontal_spacing">Horizontal Spacing: </label>
193 - <input type="text" id="horizontal_spacing" class="input-very-short" name="horizontal_spacing" value="<?php echo $plugin_data_array['horizontal_spacing']; ?>" />
199 + <input type="text" id="horizontal_spacing" class="input-very-short" name="horizontal_spacing" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['horizontal_spacing']); ?>" />
194 200 <small>Examples: 10px, 50%</small>
195 201 </div><!--yydev_phone_btn_line-->
196 202
197 203
@@ -203,40 +209,40 @@
203 209 <option value="bottom" <?php if ($plugin_data_array['vertical_position'] == "bottom") {echo "selected";} ?> >Bottom</option>
204 210 </select>
205 211
206 212 <label for="vertical_spacing">Vertical Spacing: </label>
207 - <input type="text" id="vertical_spacing" class="input-very-short" name="vertical_spacing" value="<?php echo $plugin_data_array['vertical_spacing']; ?>" />
213 + <input type="text" id="vertical_spacing" class="input-very-short" name="vertical_spacing" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['vertical_spacing']); ?>" />
208 214 <small>Examples: 10px, 50%</small>
209 215 </div><!--yydev_phone_btn_line-->
210 216
211 217 <div class="yydev_phone_btn_line">
212 218 <label for="background_color">Background color hex: </label>
213 - <input type="text" id="background_color" class="input-long" name="background_color" value="<?php echo $plugin_data_array['background_color']; ?>" />
219 + <input type="text" id="background_color" class="input-long" name="background_color" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['background_color']); ?>" />
214 220 <small>Example: #09547c</small>
215 221 </div><!--yydev_phone_btn_line-->
216 222
217 223 <div class="yydev_phone_btn_line">
218 224 <label for="background_position">Background icon position: </label>
219 - <input type="text" id="background_position" class="input-short" name="background_position" value="<?php echo $plugin_data_array['background_position']; ?>" />
225 + <input type="text" id="background_position" class="input-short" name="background_position" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['background_position']); ?>" />
220 226 <small>Example: 50% 50%, 10px 10px</small>
221 227 </div><!--yydev_phone_btn_line-->
222 228
223 229 <div class="yydev_phone_btn_line">
224 230 <label for="button_z_index">Z-index: </label>
225 - <input type="text" id="button_z_index" class="input-very-short" name="button_z_index" value="<?php echo $plugin_data_array['button_z_index']; ?>" />
231 + <input type="text" id="button_z_index" class="input-very-short" name="button_z_index" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['button_z_index']); ?>" />
226 232 <small>Example: 9999</small>
227 233 </div><!--yydev_phone_btn_line-->
228 234
229 235 <div class="yydev_phone_btn_line">
230 236 <label for="button_border">Border Settings: </label>
231 - <input type="text" id="button_border" class="input-short" name="button_border" value="<?php echo $plugin_data_array['button_border']; ?>" />
237 + <input type="text" id="button_border" class="input-short" name="button_border" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['button_border']); ?>" />
232 238 <small>Example: 2px solid #bbdeff, none</small>
233 239 </div><!--yydev_phone_btn_line-->
234 240
235 241 <div class="yydev_phone_btn_line">
236 - <img class="yydev_light_img_bg" style="background:<?php echo $plugin_data_array['background_color']; ?>" src="<?php echo $plugin_data_array['icon_image_url']; ?>" alt="" />
242 + <img class="yydev_light_img_bg" style="background:<?php echo $plugin_data_array['background_color']; ?>" src="<?php echo esc_url($plugin_data_array['icon_image_url']); ?>" alt="" />
237 243 <label for="icon_image_url">Custom Icon Url: </label>
238 - <input type="text" id="icon_image_url" class="input-very-long yydev_image_input" name="icon_image_url" value="<?php echo $plugin_data_array['icon_image_url']; ?>" />
244 + <input type="text" id="icon_image_url" class="input-very-long yydev_image_input" name="icon_image_url" value="<?php echo esc_url($plugin_data_array['icon_image_url']); ?>" />
239 245 <input type="button" name="yydev_upload_image" class="yydev_upload_image button-secondary" value="Choose Image..." />
240 246
241 247 <div class="clear"></div>
242 248 </div><!--yydev_phone_btn_line-->
@@ -256,9 +262,9 @@
256 262 </div><!--yydev_phone_btn_line-->
257 263
258 264 <div class="yydev_phone_btn_line">
259 265 <label for="mobile_width">Define mobile screen resolution (affect the 2 checkboxes above): </label>
260 - <input type="text" id="mobile_width" class="input-very-short" name="mobile_width" value="<?php echo $plugin_data_array['mobile_width']; ?>" /> PX
266 + <input type="text" id="mobile_width" class="input-very-short" name="mobile_width" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['mobile_width']); ?>" /> PX
261 267 </div><!--yydev_phone_btn_line-->
262 268
263 269
264 270 <br />
@@ -278,9 +284,9 @@
278 284 <option value="right" <?php if ($plugin_data_array['mobile_horizontal_position'] == "right") {echo "selected";} ?> >Right</option>
279 285 </select>
280 286
281 287 <label for="mobile_horizontal_spacing">Horizontal Spacing: </label>
282 - <input type="text" id="mobile_horizontal_spacing" class="input-very-short" name="mobile_horizontal_spacing" value="<?php echo $plugin_data_array['mobile_horizontal_spacing']; ?>" />
288 + <input type="text" id="mobile_horizontal_spacing" class="input-very-short" name="mobile_horizontal_spacing" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['mobile_horizontal_spacing']); ?>" />
283 289 <small>Examples: 10px, 50%</small>
284 290 </div><!--yydev_phone_btn_line-->
285 291
286 292
@@ -292,14 +298,36 @@
292 298 <option value="bottom" <?php if ($plugin_data_array['mobile_vertical_position'] == "bottom") {echo "selected";} ?> >Bottom</option>
293 299 </select>
294 300
295 301 <label for="mobile_vertical_spacing">Vertical Spacing: </label>
296 - <input type="text" id="mobile_vertical_spacing" class="input-very-short" name="mobile_vertical_spacing" value="<?php echo $plugin_data_array['mobile_vertical_spacing']; ?>" />
302 + <input type="text" id="mobile_vertical_spacing" class="input-very-short" name="mobile_vertical_spacing" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['mobile_vertical_spacing']); ?>" />
297 303 <small>Examples: 10px, 50%</small>
298 304 </div><!--yydev_phone_btn_line-->
299 305
300 306 <br />
307 + <h2> Include/Exclude Pages By ID: </h2>
301 308
309 + <p> Insert the pages ID and separate them by comma. You can use <a target="_blank" href="https://wordpress.org/plugins/show-posts-and-pages-id/">Show Pages IDs</a> plugin for help.
310 + <br /><br />
311 + Example <small>(one page)</small>: 14
312 + <br /> Example <small>(multiple pages)</small>: 14, 16, 23 </p>
313 +
314 + <div class="yydev_phone_btn_line">
315 +
316 + <label for="exclude_option">Include/Exclude Option: </label>
317 +
318 + <select name="exclude_option" id='exclude_option'>
319 + <option value="none" <?php if($plugin_data_array['exclude_option'] == "none") {echo "selected";} ?> >Not Active (Default)</option>
320 + <option value="exclude" <?php if($plugin_data_array['exclude_option'] == "exclude") {echo "selected";} ?> >Exclude Pages By ID</option>
321 + <option value="include" <?php if ($plugin_data_array['exclude_option'] == "include") {echo "selected";} ?> >Include Only On Pages</option>
322 + </select>
323 +
324 + <input type="text" id="exclude_ids" class="input-short" name="exclude_ids" value="<?php echo yydev_phone_btn_html_output($plugin_data_array['exclude_ids']); ?>" />
325 +
326 + </div><!--yydev_phone_btn_line-->
327 +
328 + <br />
329 +
302 330 <?php
303 331 // creating nonce to make sure the form was submitted correctly from the right page
304 332 wp_nonce_field( 'yydev_phone_btn_action', 'yydev_phone_btn_nonce' );
305 333 ?>
@@ -308,6 +336,8 @@
308 336
309 337 </form>
310 338
311 339 <br /><br /><br />
312 -<span id="footer-thankyou-code">This plugin was create by <a target="_blank" href="https://www.yydevelopment.com">YYDevelopment</a>. If you liked the plugin please give it a <a target="_blank" href="https://wordpress.org/plugins/phone-button/#reviews">5 stars review</a>.</span>
340 +<span id="footer-thankyou-code">This plugin was create by <a target="_blank" href="https://www.yydevelopment.com">YYDevelopment</a>. If you liked the plugin please give it a <a target="_blank" href="https://wordpress.org/plugins/phone-button/#reviews">5 stars review</a>.
341 +If you want to help support this FREE plugin <a target="_blank" href="https://www.yydevelopment.com/coffee-break/?plugin=phone-button">buy us a coffee</a>.</span>
342 +</span>
313 343 </div><!--wrap-->