PluginProbe
Insert Html Snippet / 1.4.1
Insert Html Snippet v1.4.1
1.4.6 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 All 27 releases
insert-html-snippet / admin / settings.php

settings.php in Insert Html Snippet 1.4.1, at admin/settings.php

154 lines 5.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) )
3 exit;
4 global $wpdb;
5 // Load the options
6
7
8 if(!$_POST && isset($_GET['ihs_notice'])&& $_GET['ihs_notice'] == 'hide')
9 {
10 if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'],'ihs-shw')){
11 wp_nonce_ays( 'ihs-shw');
12 exit;
13 }
14 update_option('xyz_ihs_dnt_shw_notice', "hide");
15 ?>
16 <style type='text/css'>
17 #xyz_ihs_notice_td
18 {
19 display:none !important;
20 }
21 </style>
22 <div class="xyz_ihs_system_notice_area_style1" id="xyz_ihs_system_notice_area">
23 Thanks again for using the plugin. We will never show the message again.
24 &nbsp;&nbsp;&nbsp;<span id="xyz_ihs_system_notice_area_dismiss">Dismiss</span>
25 </div>
26 <?php
27 }
28
29 if($_POST){
30 if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ihs-setting_' )) {
31 wp_nonce_ays( 'ihs-setting_' );
32 exit;
33 }
34 else {
35 $_POST=xyz_trim_deep($_POST);
36 $_POST = stripslashes_deep($_POST);
37 $xyz_ihs_limit = abs(intval($_POST['xyz_ihs_limit']));
38 $xyz_ihs_pre_ads = intval($_POST['xyz_ihs_pre_ads']);
39 $xyz_ihs_exec_in_editor = intval($_POST['xyz_ihs_exec_in_editor']);
40 if($xyz_ihs_limit==0)$xyz_ihs_limit=20;
41 $xyz_ihs_credit = sanitize_text_field($_POST['xyz_ihs_credit']);
42 if($xyz_ihs_credit=="ihs" || $xyz_ihs_credit==0)
43 {
44 update_option('xyz_credit_link',$xyz_ihs_credit);
45 }
46
47 $xyz_ihs_sortfield=sanitize_text_field($_POST['xyz_ihs_sort_by_field']);
48 if(($xyz_ihs_sortfield=="title")||($xyz_ihs_sortfield=="id"))
49 {
50 update_option('xyz_ihs_sort_field_name',$xyz_ihs_sortfield);
51 }
52
53 $xyz_ihs_sortorder=sanitize_text_field($_POST['xyz_ihs_sort_by_order']);
54 if(($xyz_ihs_sortorder=="asc")||($xyz_ihs_sortorder=="desc"))
55 {
56 update_option('xyz_ihs_sort_order',$xyz_ihs_sortorder);
57 }
58
59
60 update_option('xyz_ihs_limit',$xyz_ihs_limit);
61 update_option('xyz_ihs_exec_in_editor',$xyz_ihs_exec_in_editor);
62
63 ?>
64 <div class="xyz_ihs_system_notice_area_style1" id="xyz_ihs_system_notice_area">
65 Settings updated successfully. &nbsp;&nbsp;&nbsp;
66 <span id="xyz_ihs_system_notice_area_dismiss">Dismiss</span>
67 </div>
68 <?php
69 }
70 }
71 ?>
72 <div>
73 <form method="post">
74 <?php wp_nonce_field('ihs-setting_');?>
75 <div style="float: left;width: 98%">
76 <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
77 <legend ><h3>
78 Settings
79 </h3></legend>
80 <table class="widefat" style="width:99%;">
81 <tr valign="top">
82 <td scope="row" >
83 <label for="xyz_ihs_sort">Sorting of snippets</label>
84 </td>
85 <td>
86 <select id="xyz_ihs_sort_by_field" name="xyz_ihs_sort_by_field">
87 <option value="id" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='id'){echo 'selected';} else if(get_option('xyz_ihs_sort_field_name')=="id"){echo 'selected';} ?>>Based on create time</option>
88 <option value="title" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='title'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_field_name')=="title"){echo 'selected';} ?>>Based on name</option>
89 </select>
90 &nbsp;
91 <select id="xyz_ihs_sort_by_order" name="xyz_ihs_sort_by_order" >
92 <option value="asc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='asc'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_order')=="asc"){echo 'selected';} ?>>Ascending</option>
93 <option value="desc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='desc'){echo 'selected';} elseif(get_option('xyz_ihs_sort_order')=="desc"){echo 'selected';} ?>>Descending</option>
94 </select>
95 </td>
96 </tr>
97 <tr valign="top">
98 <td scope="row" >
99 <label for="xyz_ihs_credit">Credit link to author</label>
100 </td>
101 <td>
102 <select name="xyz_ihs_credit" id="xyz_ihs_credit">
103 <option value="ihs"
104 <?php selected(get_option('xyz_credit_link'),"ihs"); ?>>Enable</option>
105 <option value="0"
106 <?php if(get_option('xyz_credit_link')!="ihs"){echo 'selected';} ?>>Disable</option>
107 </select>
108 </td>
109 </tr>
110 <tr valign="top">
111 <td scope="row" class=" xyz_ihs_settingInput" id="">
112 <label for="xyz_ihs_limit">Pagination limit</label>
113 </td>
114 <td id="">
115 <input name="xyz_ihs_limit" type="text"
116 id="xyz_ihs_limit" value="
117 <?php if(isset($_POST['xyz_ihs_limit']) ){echo abs(intval($_POST['xyz_ihs_limit']));}else{print(get_option('xyz_ihs_limit'));} ?>" />
118 </td>
119 </tr>
120 <tr valign="top">
121 <td scope="row">
122 <label for="xyz_ihs_pre_ads">Premium Version Ads</label>
123 </td>
124 <td>
125 <select name="xyz_ihs_pre_ads" id="xyz_ihs_pre_ads">
126 <option value="0">Disable</option>
127 <option value="1" <?php selected(get_option('xyz_ihs_premium_version_ads'),1);?>>Enable</option>
128 </select>
129 </td>
130 </tr>
131 <tr valign="top">
132 <td scope="row">
133 <label for="xyz_ihs_exec_in_editor">Execute shortcodes in editors</label><br/><span style="color: #1A87B9;font-size:13px;" >[Enable/Disable Shortcode Execution in Editors (Gutenberg, Classic, Elementor, etc.)]</span>
134 </td>
135 <td>
136 <select name="xyz_ihs_exec_in_editor" id="xyz_ihs_exec_in_editor">
137 <option value="0" <?php selected(get_option('xyz_ihs_exec_in_editor'),0);?>>Disable</option>
138 <option value="1" <?php selected(get_option('xyz_ihs_exec_in_editor'),1);?>>Enable</option>
139 </select>
140 </td>
141 </tr>
142 <tr valign="top">
143 <td scope="row" class=" xyz_ihs_settingInput" id="xyz_ihs_bottomBorderNone">
144 </td>
145 <td id="xyz_ihs_bottomBorderNone">
146 <input style="margin:10px 0 20px 0;" id="submit" class="button-primary xyz_ihs_bottonWidth" type="submit" value=" Update Settings " />
147 </td>
148 </tr>
149 </table>
150 </fieldset>
151 </div>
152 </form>
153 </div>
154