Changeset 2210096
- Timestamp:
- 12/11/2019 12:28:44 PM (6 years ago)
- Location:
- dispatch-countdown
- Files:
-
- 14 edited
- 1 copied
-
tags/1.0.6 (copied) (copied from dispatch-countdown/trunk)
-
tags/1.0.6/dispatch-countdown.php (modified) (3 diffs)
-
tags/1.0.6/includes/class-dispatch-countdown.php (modified) (3 diffs)
-
tags/1.0.6/public/class-dispatch-countdown-public.php (modified) (1 diff)
-
tags/1.0.6/readme.txt (modified) (2 diffs)
-
tags/1.0.6/vendor/autoload.php (modified) (1 diff)
-
tags/1.0.6/vendor/composer/autoload_real.php (modified) (3 diffs)
-
tags/1.0.6/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/dispatch-countdown.php (modified) (3 diffs)
-
trunk/includes/class-dispatch-countdown.php (modified) (3 diffs)
-
trunk/public/class-dispatch-countdown-public.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dispatch-countdown/tags/1.0.6/dispatch-countdown.php
r2209562 r2210096 13 13 * Plugin Name: Dispatch Countdown 14 14 * Description: Displays x hours left for same day dispatch on WooCommerce shop pages. 15 * Version: 1.0. 415 * Version: 1.0.6 16 16 * Author: Andy Mardell 17 17 * Author URI: mardell.me … … 32 32 * Start at version 1.0.0 and use SemVer - https://semver.org 33 33 */ 34 define( 'DISPATCH_COUNTDOWN_VERSION', '1.0. 4' );34 define( 'DISPATCH_COUNTDOWN_VERSION', '1.0.6' ); 35 35 36 36 /** … … 66 66 67 67 } 68 69 /** 70 * Run the plugin 71 */ 68 72 dispatch_run_countdown(); -
dispatch-countdown/tags/1.0.6/includes/class-dispatch-countdown.php
r2209515 r2210096 58 58 59 59 /** 60 * The current instance of the public class 61 * 62 * @since 1.0.6 63 * @access protected 64 * @var object|Dispatch_Countdown_Public 65 */ 66 protected static $public_instance; 67 68 /** 60 69 * Define the core functionality of the plugin. 61 70 * … … 152 161 153 162 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_files' ); 154 155 $this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'get_product', 1 ); 156 $this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'display_countdown', 2 ); 157 163 $this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'display_countdown' ); 158 164 $this->loader->add_action( 'wp_ajax_nopriv_get_countdown', $plugin_public, 'get_countdown' ); 159 165 $this->loader->add_action( 'wp_ajax_get_countdown', $plugin_public, 'get_countdown' ); 160 166 167 self::$public_instance = $plugin_public; 168 161 169 } 162 170 … … 209 217 } 210 218 219 /** 220 * Get an instance of the public class 221 * 222 * @since 1.0.6 223 * @return object|Dispatch_Countdown_Public 224 */ 225 public static function get_public_instance() { 226 227 return self::$public_instance; 228 229 } 230 211 231 } -
dispatch-countdown/tags/1.0.6/public/class-dispatch-countdown-public.php
r2209171 r2210096 95 95 public function display_countdown() { 96 96 97 if ( ! $this->product ) { 98 $this->set_product(); 99 } 100 97 101 do_action( 'dispatch_countdown_before_display_countdown' ); 98 102 -
dispatch-countdown/tags/1.0.6/readme.txt
r2209562 r2210096 5 5 Tested up to: 5.3 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 47 Stable tag: 1.0.6 8 8 License: GPLv3 or later License 9 9 URI: http://www.gnu.org/licenses/gpl-3.0.html … … 29 29 2. Backend view 30 30 31 == Frequently Asked Questions == 32 33 = How do I move the countdown? = 34 35 The countdown must be called at a point where `global $product` is available, so 36 make sure to call this plugin after WooCommerce has loaded. To move the 37 countdown, you can remove the action and then add it back wherever you want: 38 39 ``` 40 /** 41 * Move dispatch countdown 42 */ 43 function your_theme_move_dispatch_countdown() { 44 $dispatch_countdown = Dispatch_Countdown::get_public_instance(); 45 remove_action( 'woocommerce_before_single_product', array( $dispatch_countdown, 'display_countdown' ) ); 46 add_action( 'your_theme_before_main_container', array( $dispatch_countdown, 'display_countdown' ) ); 47 } 48 add_action( 'init', 'your_theme_move_dispatch_countdown' ); 49 ``` 50 51 Replacing `your_theme_before_main_container` with whichever hook you wish 52 31 53 == Changelog == 54 55 = 1.0.6 = 56 * Allow dispatch countdown hook to be overridden 57 * Update documentation with how to move 58 59 = 1.0.5 = 60 * Remove some dist files 61 62 = 1.0.4 = 63 * No changes - deployment tests only 64 65 = 1.0.3 = 66 * No changes - deployment tests only 32 67 33 68 = 1.0.2 = -
dispatch-countdown/tags/1.0.6/vendor/autoload.php
r2209562 r2210096 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb0::getLoader();7 return ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getLoader(); -
dispatch-countdown/tags/1.0.6/vendor/composer/autoload_real.php
r2209562 r2210096 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb05 class ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader')); 25 25 26 26 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 28 28 require_once __DIR__ . '/autoload_static.php'; 29 29 30 call_user_func(\Composer\Autoload\ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb0::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getInitializer($loader)); 31 31 } else { 32 32 $map = require __DIR__ . '/autoload_namespaces.php'; -
dispatch-countdown/tags/1.0.6/vendor/composer/autoload_static.php
r2209562 r2210096 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb07 class ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 24 24 { 25 25 return \Closure::bind(function () use ($loader) { 26 $loader->prefixLengthsPsr4 = ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb0::$prefixLengthsPsr4;27 $loader->prefixDirsPsr4 = ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb0::$prefixDirsPsr4;26 $loader->prefixLengthsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixLengthsPsr4; 27 $loader->prefixDirsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixDirsPsr4; 28 28 29 29 }, null, ClassLoader::class); -
dispatch-countdown/trunk/dispatch-countdown.php
r2209562 r2210096 13 13 * Plugin Name: Dispatch Countdown 14 14 * Description: Displays x hours left for same day dispatch on WooCommerce shop pages. 15 * Version: 1.0. 415 * Version: 1.0.6 16 16 * Author: Andy Mardell 17 17 * Author URI: mardell.me … … 32 32 * Start at version 1.0.0 and use SemVer - https://semver.org 33 33 */ 34 define( 'DISPATCH_COUNTDOWN_VERSION', '1.0. 4' );34 define( 'DISPATCH_COUNTDOWN_VERSION', '1.0.6' ); 35 35 36 36 /** … … 66 66 67 67 } 68 69 /** 70 * Run the plugin 71 */ 68 72 dispatch_run_countdown(); -
dispatch-countdown/trunk/includes/class-dispatch-countdown.php
r2209515 r2210096 58 58 59 59 /** 60 * The current instance of the public class 61 * 62 * @since 1.0.6 63 * @access protected 64 * @var object|Dispatch_Countdown_Public 65 */ 66 protected static $public_instance; 67 68 /** 60 69 * Define the core functionality of the plugin. 61 70 * … … 152 161 153 162 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_files' ); 154 155 $this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'get_product', 1 ); 156 $this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'display_countdown', 2 ); 157 163 $this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'display_countdown' ); 158 164 $this->loader->add_action( 'wp_ajax_nopriv_get_countdown', $plugin_public, 'get_countdown' ); 159 165 $this->loader->add_action( 'wp_ajax_get_countdown', $plugin_public, 'get_countdown' ); 160 166 167 self::$public_instance = $plugin_public; 168 161 169 } 162 170 … … 209 217 } 210 218 219 /** 220 * Get an instance of the public class 221 * 222 * @since 1.0.6 223 * @return object|Dispatch_Countdown_Public 224 */ 225 public static function get_public_instance() { 226 227 return self::$public_instance; 228 229 } 230 211 231 } -
dispatch-countdown/trunk/public/class-dispatch-countdown-public.php
r2209171 r2210096 95 95 public function display_countdown() { 96 96 97 if ( ! $this->product ) { 98 $this->set_product(); 99 } 100 97 101 do_action( 'dispatch_countdown_before_display_countdown' ); 98 102 -
dispatch-countdown/trunk/readme.txt
r2209562 r2210096 5 5 Tested up to: 5.3 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 47 Stable tag: 1.0.6 8 8 License: GPLv3 or later License 9 9 URI: http://www.gnu.org/licenses/gpl-3.0.html … … 29 29 2. Backend view 30 30 31 == Frequently Asked Questions == 32 33 = How do I move the countdown? = 34 35 The countdown must be called at a point where `global $product` is available, so 36 make sure to call this plugin after WooCommerce has loaded. To move the 37 countdown, you can remove the action and then add it back wherever you want: 38 39 ``` 40 /** 41 * Move dispatch countdown 42 */ 43 function your_theme_move_dispatch_countdown() { 44 $dispatch_countdown = Dispatch_Countdown::get_public_instance(); 45 remove_action( 'woocommerce_before_single_product', array( $dispatch_countdown, 'display_countdown' ) ); 46 add_action( 'your_theme_before_main_container', array( $dispatch_countdown, 'display_countdown' ) ); 47 } 48 add_action( 'init', 'your_theme_move_dispatch_countdown' ); 49 ``` 50 51 Replacing `your_theme_before_main_container` with whichever hook you wish 52 31 53 == Changelog == 54 55 = 1.0.6 = 56 * Allow dispatch countdown hook to be overridden 57 * Update documentation with how to move 58 59 = 1.0.5 = 60 * Remove some dist files 61 62 = 1.0.4 = 63 * No changes - deployment tests only 64 65 = 1.0.3 = 66 * No changes - deployment tests only 32 67 33 68 = 1.0.2 = -
dispatch-countdown/trunk/vendor/autoload.php
r2209562 r2210096 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb0::getLoader();7 return ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getLoader(); -
dispatch-countdown/trunk/vendor/composer/autoload_real.php
r2209562 r2210096 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb05 class ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader')); 25 25 26 26 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 28 28 require_once __DIR__ . '/autoload_static.php'; 29 29 30 call_user_func(\Composer\Autoload\ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb0::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getInitializer($loader)); 31 31 } else { 32 32 $map = require __DIR__ . '/autoload_namespaces.php'; -
dispatch-countdown/trunk/vendor/composer/autoload_static.php
r2209562 r2210096 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb07 class ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 24 24 { 25 25 return \Closure::bind(function () use ($loader) { 26 $loader->prefixLengthsPsr4 = ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb0::$prefixLengthsPsr4;27 $loader->prefixDirsPsr4 = ComposerStaticInit 553ce83b1740f79d5232faf4cb96deb0::$prefixDirsPsr4;26 $loader->prefixLengthsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixLengthsPsr4; 27 $loader->prefixDirsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixDirsPsr4; 28 28 29 29 }, null, ClassLoader::class);
Note: See TracChangeset
for help on using the changeset viewer.