PluginProbe
Phone Button / 1.1.1
Phone Button v1.1.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.1.1, at include/install.php

93 lines 3.6 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 $background_position = '50% 50%';
28 $button_z_index = '9999';
29 $button_border = '4px solid #fff';
30 $hide_button_on_desktop = 0;
31 $hide_button_on_mobile = 0;
32 $mobile_width = 960;
33 $mobile_button_position_checkbox = 0;
34 $mobile_horizontal_position = 'right';
35 $mobile_horizontal_spacing = '30px';
36 $mobile_vertical_position = 'bottom';
37 $mobile_vertical_spacing = '30px';
38
39 // getting the image arrow icon
40 $icon_image_url = plugin_dir_url(dirname(__FILE__)) . 'images/phone.png';
41
42 // ----------------------------------------------
43 // insert the data into an array
44 // ----------------------------------------------
45
46 $plugin_data_array = array(
47 'display_button_checkbox' => $display_button_checkbox,
48 'phone_number' => $phone_number,
49 'button_width' => $button_width,
50 'button_height' => $button_height,
51 'border_radius' => $border_radius,
52 'horizontal_position' => $horizontal_position,
53 'horizontal_spacing' => $horizontal_spacing,
54 'vertical_position' => $vertical_position,
55 'vertical_spacing' => $vertical_spacing,
56 'background_color' => $background_color,
57 'background_position' => $background_position,
58 'button_z_index' => $button_z_index,
59 'button_border' => $button_border,
60 'hide_button_on_desktop' => $hide_button_on_desktop,
61 'hide_button_on_mobile' => $hide_button_on_mobile,
62 'mobile_width' => $mobile_width,
63 'mobile_button_position_checkbox' => $mobile_button_position_checkbox,
64 'mobile_horizontal_position' => $mobile_horizontal_position,
65 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
66 'mobile_vertical_position' => $mobile_vertical_position,
67 'mobile_vertical_spacing' => $mobile_vertical_spacing,
68 'icon_image_url' => $icon_image_url
69 ); // $creating_data_array = array(
70
71 // ----------------------------------------------
72 // creating a value with all the array data
73 // ----------------------------------------------
74
75 $array_key_name = "";
76 $array_item_value = "";
77
78 foreach($plugin_data_array as $key=>$item) {
79 $array_key_name .= "####" . $key;
80 $array_item_value .= "####" . $item;
81 } // foreach($medical_form_array as $key=>$item) {
82
83 // ----------------------------------------------
84 // inserting all the data to datbase
85 // ----------------------------------------------
86
87 $plugin_data = $array_key_name . "***" . $array_item_value;
88 $plugin_data = yydev_phone_btn_mysql_prep($plugin_data);
89
90 // update optuon on the database into wp_options
91 update_option($wp_options_name, $plugin_data);
92
93 } // if( !get_option($wp_options_name) ) {