PluginProbe
Simple Accessibility Button / 2.0.1
Simple Accessibility Button v2.0.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.8 1.0.9 1.1.0 1.1.2 1.1.4 1.1.5 1.1.6 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 All 31 releases
yydevelopment-accessibility / include / install.php

install.php in Simple Accessibility Button 2.0.1, at include/install.php

102 lines 3.8 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 $background_color = '#09547c';
19 $button_width = 45;
20 $button_height = 45;
21 $button_movment = 'fixed';
22
23 $horizontal_position = 'left';
24 $horizontal_spacing = '0px';
25 $vertical_position = 'top';
26 $vertical_spacing = '50px';
27
28 // getting the image arrow icon
29 $icon_image_url = plugin_dir_url(dirname(__FILE__)) . 'images/accessibility-icon.png';
30
31 $hide_on_mobile_checkbox = 0;
32 $hide_on_desktop_checkbox = 0;
33 $mobile_width = 960;
34 $mobile_button_position_checkbox = 0;
35 $mobile_horizontal_position = 'left';
36 $mobile_horizontal_spacing = '0px';
37 $mobile_vertical_position = 'top';
38 $mobile_vertical_spacing = '0px';
39 $accessibility_background_color = '#157cb0';
40 $accessibility_page_url = '';
41 $accessibility_page_text = __('Accessibility Statement', 'yydevelopment-accessibility');
42
43 $z_index = 99999;
44
45 $exclude_option = '';
46 $exclude_ids = '';
47
48 // ----------------------------------------------
49 // insert the data into an array
50 // ----------------------------------------------
51
52 $plugin_data_array = array(
53 'display_button_checkbox' => $display_button_checkbox,
54 'background_color' => $background_color,
55 'button_width' => $button_width,
56 'button_height' => $button_height,
57 'button_movment' => $button_movment,
58 'horizontal_position' => $horizontal_position,
59 'horizontal_spacing' => $horizontal_spacing,
60 'vertical_position' => $vertical_position,
61 'vertical_spacing' => $vertical_spacing,
62 'icon_image_url' => $icon_image_url,
63 'hide_on_mobile_checkbox' => $hide_on_mobile_checkbox,
64 'hide_on_desktop_checkbox' => $hide_on_desktop_checkbox,
65 'mobile_width' => $mobile_width,
66 'mobile_button_position_checkbox' => $mobile_button_position_checkbox,
67 'mobile_horizontal_position' => $mobile_horizontal_position,
68 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
69 'mobile_vertical_position' => $mobile_vertical_position,
70 'mobile_vertical_spacing' => $mobile_vertical_spacing,
71 'accessibility_background_color' => $accessibility_background_color,
72 'accessibility_page_url' => $accessibility_page_url,
73 'accessibility_page_text' => $accessibility_page_text,
74 'z_index' => $z_index,
75
76 'exclude_option' => $exclude_option,
77 'exclude_ids' => $exclude_ids,
78 ); // $creating_data_array = array(
79
80 // ----------------------------------------------
81 // creating a value with all the array data
82 // ----------------------------------------------
83
84 $array_key_name = "";
85 $array_item_value = "";
86
87 foreach($plugin_data_array as $key=>$item) {
88 $array_key_name .= "####" . $key;
89 $array_item_value .= "####" . $item;
90 } // foreach($medical_form_array as $key=>$item) {
91
92 // ----------------------------------------------
93 // inserting all the data to datbase
94 // ----------------------------------------------
95
96 $plugin_data = $array_key_name . "***" . $array_item_value;
97 $plugin_data = yydev_accessibility_mysql_prep($plugin_data);
98
99 // update optuon on the database into wp_options
100 update_option($wp_options_name, $plugin_data);
101
102 } // if( !get_option($wp_options_name) ) {