Changeset 1085507
- Timestamp:
- 02/09/2015 01:06:17 PM (11 years ago)
- File:
-
- 1 edited
-
wp-sticky-header/trunk/wp-sticky-header.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-sticky-header/trunk/wp-sticky-header.php
r1001076 r1085507 4 4 * Plugin URI: http://wordpress.org/plugins/wp-sticky-header/ 5 5 * Description: Plugin to display some content/notification on top of the webpage. 6 * Version: 1. 26 * Version: 1.3 7 7 * Author: wpnaga 8 8 * Author URI: http://profiles.wordpress.org/wpnaga/ … … 29 29 register_setting( 'wpsh-settings-group', 'wpsh_text_color' ); 30 30 register_setting( 'wpsh-settings-group', 'wpsh_closable' ); 31 register_setting( 'wpsh-settings-group', 'wpsh_position' ); 31 32 register_setting( 'wpsh-settings-group', 'wpsh_content' ); 32 33 register_setting( 'wpsh-settings-group', 'wpsh_where' ); … … 56 57 <th scope="row">Is Closable?</th> 57 58 <td><input type="checkbox" name="wpsh_closable" value="1" <?php if(esc_attr( get_option('wpsh_closable'))) echo "checked"; ?> /> can the viewer close the header?</td> 59 </tr> 60 61 <tr valign="top"> 62 <th scope="row">Position</th> 63 <td> 64 <p><input type="radio" class="display" name="wpsh_position" value="top" <?php if(esc_attr( get_option('wpsh_position')) == "top") echo "checked"; ?> /><b>Top</b> </p> 65 <p><input type="radio" class="display" name="wpsh_position" value="bottom" <?php if(esc_attr( get_option('wpsh_position')) == "bottom") echo "checked"; ?> /><b>Bottom</b> </p> 66 </td> 58 67 </tr> 59 68 … … 151 160 position: fixed; 152 161 text-align: center; 153 top: 0;162 <?php if(esc_attr(get_option('wpsh_position')) == 'top') { echo "top: 0;"; } else { echo "bottom:0;"; } ?> 154 163 font-weight:bold; 155 164 width: 100%; … … 164 173 margin-right:30px; 165 174 font-weight:bold; 166 padding:5px;167 175 } 168 176 .wpsh_close:hover{ … … 175 183 176 184 add_action( 'admin_init', 'wpsh_admin_init' ); 185 add_action( 'upgrader_process_complete', function() { add_option('wpsh_position','top'); }); 177 186 178 187 function wpsh_admin_init() { … … 201 210 add_option('wpsh_closable','1'); 202 211 } 212 if(!get_option('wpsh_position')){ 213 add_option('wpsh_position','top'); 214 } 203 215 if(!get_option('wpsh_content')){ 204 216 add_option('wpsh_content','Thanks for using Sticky Header'); … … 214 226 delete_option('wpsh_text_color'); 215 227 delete_option('wpsh_closable'); 228 delete_option('wpsh_position'); 216 229 delete_option('wpsh_content'); 217 230 }
Note: See TracChangeset
for help on using the changeset viewer.