PluginProbe
Simple Accessibility Button / 1.0.2
Simple Accessibility Button v1.0.2
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 1.0.2, 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 $background_color = '#09547c';
19 $button_width = 45;
20 $button_height = 45;
21 $button_movment = 'absolute';
22
23 $horizontal_position = 'left';
24 $horizontal_spacing = '0px';
25 $vertical_position = 'top';
26 $vertical_spacing = '0px';
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', 'yydev_accessibility');
42
43 // ----------------------------------------------
44 // insert the data into an array
45 // ----------------------------------------------
46
47 $plugin_data_array = array(
48 'display_button_checkbox' => $display_button_checkbox,
49 'background_color' => $background_color,
50 'button_width' => $button_width,
51 'button_height' => $button_height,
52 'button_movment' => $button_movment,
53 'horizontal_position' => $horizontal_position,
54 'horizontal_spacing' => $horizontal_spacing,
55 'vertical_position' => $vertical_position,
56 'vertical_spacing' => $vertical_spacing,
57 'icon_image_url' => $icon_image_url,
58 'hide_on_mobile_checkbox' => $hide_on_mobile_checkbox,
59 'hide_on_desktop_checkbox' => $hide_on_desktop_checkbox,
60 'mobile_width' => $mobile_width,
61 'mobile_button_position_checkbox' => $mobile_button_position_checkbox,
62 'mobile_horizontal_position' => $mobile_horizontal_position,
63 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
64 'mobile_vertical_position' => $mobile_vertical_position,
65 'mobile_vertical_spacing' => $mobile_vertical_spacing,
66 'accessibility_background_color' => $accessibility_background_color,
67 'accessibility_page_url' => $accessibility_page_url,
68 'accessibility_page_text' => $accessibility_page_text,
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_accessibility_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) ) {