Changeset 3189525
- Timestamp:
- 11/15/2024 12:11:32 PM (17 months ago)
- Location:
- simple-side-tab
- Files:
-
- 8 edited
- 1 copied
-
tags/2.2.0 (copied) (copied from simple-side-tab/trunk)
-
tags/2.2.0/admin/class-simple-side-tab-admin.php (modified) (2 diffs)
-
tags/2.2.0/public/partials/dynamic-css.php (modified) (1 diff)
-
tags/2.2.0/readme.txt (modified) (2 diffs)
-
tags/2.2.0/simple_side_tab.php (modified) (2 diffs)
-
trunk/admin/class-simple-side-tab-admin.php (modified) (2 diffs)
-
trunk/public/partials/dynamic-css.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple_side_tab.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-side-tab/tags/2.2.0/admin/class-simple-side-tab-admin.php
r2857412 r3189525 120 120 public function settings_api_init() { 121 121 122 register_setting( 'rum_sst_option_group', 'rum_sst_plugin_options' ); 122 register_setting( 123 'rum_sst_option_group', 124 'rum_sst_plugin_options', 125 [ 126 'sanitize_callback' => [ $this, 'sanitize_plugin_options' ] 127 ] 128 ); 123 129 } 124 130 … … 176 182 } 177 183 184 185 186 187 /** 188 * Sanitize the plugin options. 189 * 190 * @param array $input The unsanitized options input. 191 * @return array The sanitized options. 192 */ 193 public function sanitize_plugin_options( $input ) { 194 $sanitized = []; 195 196 $valid_fonts = [ 197 'Arial, sans-serif', 198 'Georgia, serif', 199 '"Helvetica Neue", Helvetica, sans-serif', 200 '"Lucida Sans Unicode", "Lucida Grande", sans-serif', 201 'Tahoma, sans-serif', 202 '"Trebuchet MS", sans-serif', 203 'Verdana, sans-serif' 204 ]; 205 206 $valid_positions = [ 'left', 'right' ]; 207 208 if ( isset( $input['text_for_tab'] ) ) { 209 $sanitized['text_for_tab'] = sanitize_text_field( $input['text_for_tab'] ); 210 } 211 212 if ( isset( $input['tab_url'] ) ) { 213 $sanitized['tab_url'] = sanitize_url( $input['tab_url'] ); 214 } 215 216 if ( isset( $input['font_family'] ) && in_array( $input['font_family'], $valid_fonts, true ) ) { 217 $sanitized['font_family'] = $input['font_family']; 218 } else { 219 $sanitized['font_family'] = 'Arial, sans-serif'; 220 } 221 222 if ( isset( $input['font_weight_bold'] ) && $input['font_weight_bold'] === '1' ) { 223 $sanitized['font_weight_bold'] = '1'; 224 } 225 226 if ( isset( $input['text_shadow'] ) && $input['text_shadow'] === '1' ) { 227 $sanitized['text_shadow'] = '1'; 228 } 229 230 if ( isset( $input['target_blank'] ) && $input['target_blank'] === '1' ) { 231 $sanitized['target_blank'] = '1'; 232 } 233 234 if ( isset( $input['left_right'] ) && in_array( $input['left_right'], $valid_positions, true ) ) { 235 $sanitized['left_right'] = $input['left_right']; 236 } else { 237 $sanitized['left_right'] = 'left'; 238 } 239 240 if ( isset( $input['pixels_from_top'] ) && is_numeric( $input['pixels_from_top'] ) && absint( $input['pixels_from_top'] ) > 0 ) { 241 $sanitized['pixels_from_top'] = absint( $input['pixels_from_top'] ); 242 } else { 243 $sanitized['pixels_from_top'] = 350; 244 } 245 246 if ( isset( $input['text_color'] ) ) { 247 $sanitized['text_color'] = sanitize_hex_color( $input['text_color'] ); 248 if ( ! $sanitized['text_color'] ) { 249 $sanitized['text_color'] = '#ffffff'; 250 } 251 } else { 252 $sanitized['text_color'] = '#ffffff'; 253 } 254 255 if ( isset( $input['tab_color'] ) ) { 256 $sanitized['tab_color'] = sanitize_hex_color( $input['tab_color'] ); 257 if ( ! $sanitized['tab_color'] ) { 258 $sanitized['tab_color'] = '#a0244e'; 259 } 260 } else { 261 $sanitized['tab_color'] = '#a0244e'; 262 } 263 264 if ( isset( $input['hover_color'] ) ) { 265 $sanitized['hover_color'] = sanitize_hex_color( $input['hover_color'] ); 266 if ( ! $sanitized['hover_color'] ) { 267 $sanitized['hover_color'] = '#a4a4a4'; 268 } 269 } else { 270 $sanitized['hover_color'] = '#a4a4a4'; 271 } 272 273 return $sanitized; 274 } 178 275 } -
simple-side-tab/tags/2.2.0/public/partials/dynamic-css.php
r2483076 r3189525 15 15 /* START Styles Simple Side Tab v<?php echo SIMPLE_SIDE_TAB_VERSION ?> */ 16 16 #rum_sst_tab { 17 font-family: <?php echo $this->settings->font_family; ?>;18 top: <?php echo $this->settings->pixels_from_top; ?>px;19 background-color: <?php echo $this->settings->tab_color; ?>;20 color: <?php echo $this->settings->text_color; ?>;21 border-style: solid;22 border-width: 0px;17 font-family: <?php echo esc_attr( $this->settings->font_family ); ?>; 18 top: <?php echo esc_attr( intval( $this->settings->pixels_from_top ) ); ?>px; 19 background-color: <?php echo esc_attr( $this->settings->tab_color ); ?>; 20 color: <?php echo esc_attr( $this->settings->text_color ); ?>; 21 border-style: solid; 22 border-width: 0px; 23 23 } 24 24 25 25 #rum_sst_tab:hover { 26 background-color: <?php echo $this->settings->hover_color; ?>;26 background-color: <?php echo esc_attr( $this->settings->hover_color ); ?>; 27 27 <?php 28 28 if ( $this->settings->text_shadow ) { -
simple-side-tab/tags/2.2.0/readme.txt
r3118676 r3189525 3 3 Tags: tab, side tab, navigation, call to action, page link 4 4 Requires at least: 6.0 5 Tested up to: 6. 66 Stable tag: 2. 1.145 Tested up to: 6.7 6 Stable tag: 2.2.0 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 80 80 81 81 == Changelog == 82 83 = 2.2.0 = 84 * Tested up to: 6.7 85 * Updated register_setting() 82 86 83 87 = 2.1.14 = -
simple-side-tab/tags/2.2.0/simple_side_tab.php
r3118676 r3189525 4 4 * Plugin URI: https://rumspeed.com/wordpress-plugins/simple-side-tab/ 5 5 * Description: Display a side tab that you can easily link to any page. Customize the tab text, font and colors. It's that simple. That's Simple Side Tab. 6 * Version: 2. 1.146 * Version: 2.2.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 47 47 * Plugin constants. 48 48 */ 49 define( 'SIMPLE_SIDE_TAB_VERSION', '2. 1.14' );49 define( 'SIMPLE_SIDE_TAB_VERSION', '2.2.0' ); 50 50 define( 'SIMPLE_SIDE_TAB_DIR', dirname( __FILE__ ) ); 51 51 define( 'SIMPLE_SIDE_TAB_URI', plugins_url( '' , __FILE__ ) ); -
simple-side-tab/trunk/admin/class-simple-side-tab-admin.php
r2857412 r3189525 120 120 public function settings_api_init() { 121 121 122 register_setting( 'rum_sst_option_group', 'rum_sst_plugin_options' ); 122 register_setting( 123 'rum_sst_option_group', 124 'rum_sst_plugin_options', 125 [ 126 'sanitize_callback' => [ $this, 'sanitize_plugin_options' ] 127 ] 128 ); 123 129 } 124 130 … … 176 182 } 177 183 184 185 186 187 /** 188 * Sanitize the plugin options. 189 * 190 * @param array $input The unsanitized options input. 191 * @return array The sanitized options. 192 */ 193 public function sanitize_plugin_options( $input ) { 194 $sanitized = []; 195 196 $valid_fonts = [ 197 'Arial, sans-serif', 198 'Georgia, serif', 199 '"Helvetica Neue", Helvetica, sans-serif', 200 '"Lucida Sans Unicode", "Lucida Grande", sans-serif', 201 'Tahoma, sans-serif', 202 '"Trebuchet MS", sans-serif', 203 'Verdana, sans-serif' 204 ]; 205 206 $valid_positions = [ 'left', 'right' ]; 207 208 if ( isset( $input['text_for_tab'] ) ) { 209 $sanitized['text_for_tab'] = sanitize_text_field( $input['text_for_tab'] ); 210 } 211 212 if ( isset( $input['tab_url'] ) ) { 213 $sanitized['tab_url'] = sanitize_url( $input['tab_url'] ); 214 } 215 216 if ( isset( $input['font_family'] ) && in_array( $input['font_family'], $valid_fonts, true ) ) { 217 $sanitized['font_family'] = $input['font_family']; 218 } else { 219 $sanitized['font_family'] = 'Arial, sans-serif'; 220 } 221 222 if ( isset( $input['font_weight_bold'] ) && $input['font_weight_bold'] === '1' ) { 223 $sanitized['font_weight_bold'] = '1'; 224 } 225 226 if ( isset( $input['text_shadow'] ) && $input['text_shadow'] === '1' ) { 227 $sanitized['text_shadow'] = '1'; 228 } 229 230 if ( isset( $input['target_blank'] ) && $input['target_blank'] === '1' ) { 231 $sanitized['target_blank'] = '1'; 232 } 233 234 if ( isset( $input['left_right'] ) && in_array( $input['left_right'], $valid_positions, true ) ) { 235 $sanitized['left_right'] = $input['left_right']; 236 } else { 237 $sanitized['left_right'] = 'left'; 238 } 239 240 if ( isset( $input['pixels_from_top'] ) && is_numeric( $input['pixels_from_top'] ) && absint( $input['pixels_from_top'] ) > 0 ) { 241 $sanitized['pixels_from_top'] = absint( $input['pixels_from_top'] ); 242 } else { 243 $sanitized['pixels_from_top'] = 350; 244 } 245 246 if ( isset( $input['text_color'] ) ) { 247 $sanitized['text_color'] = sanitize_hex_color( $input['text_color'] ); 248 if ( ! $sanitized['text_color'] ) { 249 $sanitized['text_color'] = '#ffffff'; 250 } 251 } else { 252 $sanitized['text_color'] = '#ffffff'; 253 } 254 255 if ( isset( $input['tab_color'] ) ) { 256 $sanitized['tab_color'] = sanitize_hex_color( $input['tab_color'] ); 257 if ( ! $sanitized['tab_color'] ) { 258 $sanitized['tab_color'] = '#a0244e'; 259 } 260 } else { 261 $sanitized['tab_color'] = '#a0244e'; 262 } 263 264 if ( isset( $input['hover_color'] ) ) { 265 $sanitized['hover_color'] = sanitize_hex_color( $input['hover_color'] ); 266 if ( ! $sanitized['hover_color'] ) { 267 $sanitized['hover_color'] = '#a4a4a4'; 268 } 269 } else { 270 $sanitized['hover_color'] = '#a4a4a4'; 271 } 272 273 return $sanitized; 274 } 178 275 } -
simple-side-tab/trunk/public/partials/dynamic-css.php
r2483076 r3189525 15 15 /* START Styles Simple Side Tab v<?php echo SIMPLE_SIDE_TAB_VERSION ?> */ 16 16 #rum_sst_tab { 17 font-family: <?php echo $this->settings->font_family; ?>;18 top: <?php echo $this->settings->pixels_from_top; ?>px;19 background-color: <?php echo $this->settings->tab_color; ?>;20 color: <?php echo $this->settings->text_color; ?>;21 border-style: solid;22 border-width: 0px;17 font-family: <?php echo esc_attr( $this->settings->font_family ); ?>; 18 top: <?php echo esc_attr( intval( $this->settings->pixels_from_top ) ); ?>px; 19 background-color: <?php echo esc_attr( $this->settings->tab_color ); ?>; 20 color: <?php echo esc_attr( $this->settings->text_color ); ?>; 21 border-style: solid; 22 border-width: 0px; 23 23 } 24 24 25 25 #rum_sst_tab:hover { 26 background-color: <?php echo $this->settings->hover_color; ?>;26 background-color: <?php echo esc_attr( $this->settings->hover_color ); ?>; 27 27 <?php 28 28 if ( $this->settings->text_shadow ) { -
simple-side-tab/trunk/readme.txt
r3118676 r3189525 3 3 Tags: tab, side tab, navigation, call to action, page link 4 4 Requires at least: 6.0 5 Tested up to: 6. 66 Stable tag: 2. 1.145 Tested up to: 6.7 6 Stable tag: 2.2.0 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 80 80 81 81 == Changelog == 82 83 = 2.2.0 = 84 * Tested up to: 6.7 85 * Updated register_setting() 82 86 83 87 = 2.1.14 = -
simple-side-tab/trunk/simple_side_tab.php
r3118676 r3189525 4 4 * Plugin URI: https://rumspeed.com/wordpress-plugins/simple-side-tab/ 5 5 * Description: Display a side tab that you can easily link to any page. Customize the tab text, font and colors. It's that simple. That's Simple Side Tab. 6 * Version: 2. 1.146 * Version: 2.2.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 47 47 * Plugin constants. 48 48 */ 49 define( 'SIMPLE_SIDE_TAB_VERSION', '2. 1.14' );49 define( 'SIMPLE_SIDE_TAB_VERSION', '2.2.0' ); 50 50 define( 'SIMPLE_SIDE_TAB_DIR', dirname( __FILE__ ) ); 51 51 define( 'SIMPLE_SIDE_TAB_URI', plugins_url( '' , __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.