Changeset 2359297
- Timestamp:
- 08/12/2020 06:11:26 PM (6 years ago)
- Location:
- preloader-plus/trunk
- Files:
-
- 4 edited
-
inc/customizer.php (modified) (2 diffs)
-
inc/preloader-plus.php (modified) (4 diffs)
-
preloader-plus.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
preloader-plus/trunk/inc/customizer.php
r1852333 r2359297 6 6 'elements' => apply_filters( 'preloader_plus_elements_default', array( 'icon', 'progress_bar' ) ), 7 7 'show_on_front' => false, 8 'show_once' => false, 8 9 'custom_content' => '', 9 10 'bg_color' => '#141414', … … 128 129 ) ); 129 130 131 $wp_customize->add_setting( 'preloader_plus_settings[show_once]', array( 132 'type' => 'option', 133 'capability' => 'edit_theme_options', 134 'default' => $defaults['show_once'], 135 'transport' => 'refresh', 136 'sanitize_callback' => 'preloader_plus_sanitize_checkbox', 137 ) ); 138 139 $wp_customize->add_control( 'preloader_plus_settings[show_once]', array( 140 'type' => 'checkbox', 141 'section' => 'preloader_plus_settings', 142 'label' => __( 'Show the preloader only on first visit', 'preloader-plus' ), 143 'priority' => 10, 144 ) ); 145 130 146 $wp_customize->add_setting( 'preloader_plus_settings[elements]', array( 131 147 'type' => 'option', -
preloader-plus/trunk/inc/preloader-plus.php
r2333543 r2359297 66 66 add_action( 'upload_mimes', array( $this, 'add_svg_mime' ) ); 67 67 add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); 68 add_action( 'init', array( $this, 'show_once' ) ); 68 69 69 70 // Rate reminder actions. … … 147 148 preloader_plus_get_default() 148 149 ); 149 if( false !== $preloader_plus_settings['show_on_front'] && ! is_front_page() ) {150 if( ( false !== $preloader_plus_settings['show_on_front'] && ! is_front_page() ) || ( false !== $preloader_plus_settings['show_once'] && isset( $_COOKIE['show_preloader_once'] ) ) ) { 150 151 return; 151 152 } … … 217 218 } 218 219 220 /** 221 * Set a cookie to show the preloader once per session. 222 * 223 * @since 2.2 224 */ 225 public function show_once() { 226 $settings = $this->get_options(); 227 if( false !== $settings['show_once'] ) { 228 if ( !isset( $_COOKIE['show_preloader_once'] ) ) { 229 setcookie("show_preloader_once", 'show preloader once'); 230 } 231 else { 232 return; 233 } 234 } 235 } 219 236 220 237 /** … … 229 246 // Get preloader options. 230 247 $settings = $this->get_options(); 248 249 if( false !== $settings['show_once'] ) { 250 if ( isset( $_COOKIE['show_preloader_once'] ) ) { 251 return; 252 } 253 } 254 255 // Doesn't show the preloader if show on front is true and this is not the front page 231 256 if( false !== $settings['show_on_front'] && ! is_front_page() ) { 232 257 return; -
preloader-plus/trunk/preloader-plus.php
r2336697 r2359297 5 5 Plugin URI: https://wordpress.org/plugins/preloader-plus/ 6 6 Description: Add a page loading screen to your website with style and animations, easy to customize, works on all major browsers and with any theme, any device. 7 Version: 2. 1.27 Version: 2.2 8 8 Author: Massimo Sanfelice | Maxsdesign 9 9 Author URI: https://wp-brandtheme.com … … 86 86 public function set_plugin_version_constant() { 87 87 if ( ! defined( 'PRELOADER_PLUS_VERSION' ) ) { 88 define( 'PRELOADER_PLUS_VERSION', '2. 1.2' );88 define( 'PRELOADER_PLUS_VERSION', '2.2' ); 89 89 } 90 90 } -
preloader-plus/trunk/readme.txt
r2336697 r2359297 3 3 Tags: preloader, page loader, loader, page loading, loading screen, page loading screen, loading page 4 4 Requires at least: 4.6 5 Tested up to: 5. 46 Stable tag: 2. 1.25 Tested up to: 5.5 6 Stable tag: 2.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 26 26 * Show the preloader on every page or only on the front page. 27 * Show the preloader only on the first visit. 27 28 * Add a custom image (jpg, png, gif, svg). 28 29 * Set animations and speed for your custom image. … … 67 68 68 69 == Changelog == 70 71 = 2.2 = 72 73 *Release Date: August 11, 2020* 74 75 * Added option to show the preloader only on the first visit. 69 76 70 77 = 2.1.2 =
Note: See TracChangeset
for help on using the changeset viewer.