PluginProbe
Phone Button / 1.0.1
Phone Button v1.0.1
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
phone-button / include / install.php

install.php in Phone Button 1.0.1, at include/install.php

87 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2 <?php
3
4 include('settings.php'); // Load the files to get the databse info
5
6 // ----------------------------------------------
7 // checking if the data existing on the db and
8 // if not we will create it with initial settings
9 // ----------------------------------------------
10
11 if( !get_option($wp_options_name) ) {
12
13 // ----------------------------------------------
14 // getting all the values and clear data
15 // ----------------------------------------------
16
17 $display_button_checkbox = 1;
18 $phone_number = '';
19 $button_width = 70;
20 $button_height = 70;
21 $border_radius = '50%';
22 $horizontal_position = 'right';
23 $horizontal_spacing = '30px';
24 $vertical_position = 'bottom';
25 $vertical_spacing = '30px';
26 $background_color = 'linear-gradient(180deg, #00bc3c, #008d32)';
27 $button_border = '4px solid #fff';
28 $mobile_display_checkbox = 0;
29 $mobile_width = 960;
30 $mobile_button_position_checkbox = 0;
31 $mobile_horizontal_position = 'right';
32 $mobile_horizontal_spacing = '30px';
33 $mobile_vertical_position = 'bottom';
34 $mobile_vertical_spacing = '30px';
35
36 // getting the image arrow icon
37 $icon_image_url = plugin_dir_url(dirname(__FILE__)) . 'images/phone.png';
38
39 // ----------------------------------------------
40 // insert the data into an array
41 // ----------------------------------------------
42
43 $plugin_data_array = array(
44 'display_button_checkbox' => $display_button_checkbox,
45 'phone_number' => $phone_number,
46 'button_width' => $button_width,
47 'button_height' => $button_height,
48 'border_radius' => $border_radius,
49 'horizontal_position' => $horizontal_position,
50 'horizontal_spacing' => $horizontal_spacing,
51 'vertical_position' => $vertical_position,
52 'vertical_spacing' => $vertical_spacing,
53 'background_color' => $background_color,
54 'button_border' => $button_border,
55 'mobile_display_checkbox' => $mobile_display_checkbox,
56 'mobile_width' => $mobile_width,
57 'mobile_button_position_checkbox' => $mobile_button_position_checkbox,
58 'mobile_horizontal_position' => $mobile_horizontal_position,
59 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
60 'mobile_vertical_position' => $mobile_vertical_position,
61 'mobile_vertical_spacing' => $mobile_vertical_spacing,
62 'icon_image_url' => $icon_image_url
63 ); // $creating_data_array = array(
64
65 // ----------------------------------------------
66 // creating a value with all the array data
67 // ----------------------------------------------
68
69 $array_key_name = "";
70 $array_item_value = "";
71
72 foreach($plugin_data_array as $key=>$item) {
73 $array_key_name .= "####" . $key;
74 $array_item_value .= "####" . $item;
75 } // foreach($medical_form_array as $key=>$item) {
76
77 // ----------------------------------------------
78 // inserting all the data to datbase
79 // ----------------------------------------------
80
81 $plugin_data = $array_key_name . "***" . $array_item_value;
82 $plugin_data = yydev_phone_btn_mysql_prep($plugin_data);
83
84 // update optuon on the database into wp_options
85 update_option($wp_options_name, $plugin_data);
86
87 } // if( !get_option($wp_options_name) ) {