Changeset 3110212
- Timestamp:
- 07/01/2024 07:23:39 AM (21 months ago)
- Location:
- sticky-on-scroll
- Files:
-
- 6 added
- 6 edited
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
assets/screenshot-1.png (modified) (previous)
-
trunk/admin/stsc-admin-settings.php (modified) (1 diff)
-
trunk/assets/css/stsc-admin-style.css (modified) (1 diff)
-
trunk/assets/js/jquery.custom.js (modified) (1 diff)
-
trunk/languages (added)
-
trunk/languages/sticky-scroll.pot (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sticky-on-scroll.php (modified) (3 diffs)
-
trunk/uninstall.php (added)
Legend:
- Unmodified
- Added
- Removed
-
sticky-on-scroll/trunk/admin/stsc-admin-settings.php
r1725379 r3110212 1 1 <?php 2 function stsc_register_settings() { 3 add_option( 'stsc_Elements', ''); 4 add_option( 'stsc_min_screen', '480'); 5 register_setting( 'stsc_options_group', 'stsc_Elements', 'stsc_Settings_callback' ); 6 register_setting( 'stsc_options_group', 'stsc_min_screen', 'stsc_Settings_callback' ); 2 if ( ! function_exists( 'stsc_register_settings' ) ) { 3 function stsc_register_settings() { 4 add_option( 'stsc_Elements', ''); 5 add_option( 'stsc_min_screen', '480'); 6 register_setting( 'stsc_options_group', 'stsc_Elements', 'stsc_Settings_callback' ); 7 register_setting( 'stsc_options_group', 'stsc_min_screen', 'stsc_Settings_callback' ); 8 } 9 add_action( 'admin_init', 'stsc_register_settings' ); 7 10 } 8 add_action( 'admin_init', 'stsc_register_settings' );9 11 10 function stsc_register_options_page() { 11 add_options_page('Sticky on Scroll', 'Sticky on Scroll', 'manage_options', 'stsc_register_options_page', 'stsc_options_page'); 12 if ( ! function_exists( 'stsc_register_options_page' ) ) { 13 function stsc_register_options_page() { 14 add_options_page(__('Sticky on Scroll', 'sticky-scroll'), __('Sticky on Scroll', 'sticky-scroll'), 'manage_options', 'stsc_register_options_page', 'stsc_options_page'); 15 } 16 add_action('admin_menu', 'stsc_register_options_page'); 12 17 } 13 add_action('admin_menu', 'stsc_register_options_page');14 18 15 function stsc_options_page() 16 { 17 ?> 18 <div class="stsc-form"> 19 <?php screen_icon(); ?> 20 <form method="post" action="options.php"> 21 <?php settings_fields( 'stsc_options_group' ); ?> 22 <h2><?php echo __('Sticky on Scroll', 'sticky-scroll'); ?></h2> 23 <p><?php echo __('You can pick any element that you want to stick on top of the page when you scroll down. It can be used for navigation menus or any element that you want as sticky.', 'sticky-scroll'); ?></p> 24 <table> 25 <tr valign="top"> 26 <th scope="row"><label for="stsc_Elements"><?php echo __('Sticky Element','sticky-scroll'); ?></label></th> 27 <td><input type="text" id="stsc_Elements" name="stsc_Elements" value="<?php echo get_option('stsc_Elements'); ?>" /> <?php echo __('(eg. #navigation, header, section, .sticky-section)', 'sticky-scroll'); ?></td> 28 </tr> 29 30 <tr valign="top"> 31 <th scope="row"><label for="stsc_min_screen"><?php echo __('Minimum screen size to set elements sticky.','sticky-scroll'); ?></label></th> 32 <td><input type="text" id="stsc_min_screen" name="stsc_min_screen" value="<?php echo get_option('stsc_min_screen'); ?>" /> <?php echo __('pixels','sticky-scroll'); ?></td> 33 </tr> 34 35 </table> 36 <?php submit_button(); ?> 37 </form> 38 </div> 39 <?php 40 } ?> 19 if ( ! function_exists( 'stsc_options_page' ) ) { 20 function stsc_options_page(){ ?> 21 <div class="stsc-form"> 22 <form method="post" action="options.php"> 23 <?php settings_fields( 'stsc_options_group' ); ?> 24 <h2><?php echo __('Sticky on Scroll', 'sticky-scroll'); ?></h2> 25 <p><?php echo __('You can pick any element that you want to stick on top of the page when you scroll down. It can be used for navigation menus or any element that you want as sticky.', 'sticky-scroll'); ?></p> 26 <table> 27 <tr valign="top"> 28 <th scope="row"><label for="stsc_Elements"><?php echo __('Sticky Element (ID or Class)','sticky-scroll'); ?></label></th> 29 <td><input type="text" id="stsc_Elements" name="stsc_Elements" value="<?php echo get_option('stsc_Elements'); ?>" /> <br /><?php echo __('(eg. #navigation, header, section, .sticky-section)', 'sticky-scroll'); ?></td> 30 </tr> 31 <tr><td colspan="2"> </td></tr> 32 <tr valign="top"> 33 <th scope="row"><label for="stsc_min_screen"><?php echo __('Minimum screen size to set elements sticky.','sticky-scroll'); ?></label></th> 34 <td><input type="text" id="stsc_min_screen" name="stsc_min_screen" value="<?php echo get_option('stsc_min_screen'); ?>" /> <?php echo __('pixels','sticky-scroll'); ?></td> 35 </tr> 36 </table> 37 <?php submit_button(); ?> 38 </form> 39 </div> 40 <?php 41 } 42 } -
sticky-on-scroll/trunk/assets/css/stsc-admin-style.css
r1725379 r3110212 1 1 .stsc-form table th{ 2 2 text-align:left; 3 width:30%; 3 width:40%; 4 } 5 .stsc-form table th label{ 6 font-size: 16px; 7 } 8 .stsc-form table td input{ 9 width: 90%; 4 10 } 5 11 .stsc-form h2{ -
sticky-on-scroll/trunk/assets/js/jquery.custom.js
r1729194 r3110212 1 jQuery(document).ready(function($) { 2 3 var current_width = jQuery(window).width(); 4 5 if(SS_obj.selectors!='' && current_width > SS_obj.width){ 6 jQuery(SS_obj.selectors).stopAtTop(); 7 } 8 9 }); 1 (function($) { 2 jQuery(document).ready(function($) { 3 var current_width = jQuery(window).width(); 4 if(SS_obj.selectors!='' && current_width > SS_obj.width){ 5 jQuery(SS_obj.selectors).stopAtTop(); 6 } 7 }); 8 })(jQuery); -
sticky-on-scroll/trunk/readme.txt
r1729194 r3110212 2 2 Contributors: latifpala 3 3 Tags: sticky, navigation, header, menu, sticky header, sticky menu 4 Requires at least: 3.55 Tested up to: 4.8.14 Requires at least: 5.0 5 Tested up to: 6.5.5 6 6 Stable tag: 1.0 7 7 License: GPLv2 or later … … 50 50 = 1.0.1 = 51 51 Alert bug fixed. 52 53 = 2.0.0 = 54 Translation Added 55 Tested upto new WP Version 56 Minor bugs fixed -
sticky-on-scroll/trunk/sticky-on-scroll.php
r1729194 r3110212 3 3 Plugin Name: Sticky on Scroll 4 4 Description: You can pick any element that you want to stick on top of the page when you scroll down. It can be used for navigation menus or any element that you want as sticky. 5 Version: 1.0.1 5 Version: 2.0.0 6 Requires at least: 5.2 7 Requires PHP: 7.2 8 License: GPL v2 or later 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 6 10 Author: Latif Pala 7 11 Author URI: https://profiles.wordpress.org/latifpala 12 Domain Path: /languages 8 13 Text Domain: sticky-scroll 9 14 */ … … 11 16 12 17 define('STSC_ROOT', plugin_dir_path(__FILE__)); 13 14 function stsc_uninstall(){15 delete_option( 'stsc_Elements' );16 delete_option( 'stsc_min_screen' );17 }18 register_uninstall_hook( __FILE__, 'stsc_uninstall' );19 18 20 19 function stsc_load_custom_scripts($hook) { … … 44 43 add_action('admin_enqueue_scripts', 'stsc_load_admin_custom_scripts'); 45 44 45 add_action( 'init', 'stsc_load_textdomain' ); 46 function stsc_load_textdomain() { 47 load_plugin_textdomain( 'sticky-scroll', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 48 } 46 49 require dirname( __FILE__ ) . '/admin/stsc-admin-settings.php';
Note: See TracChangeset
for help on using the changeset viewer.