Plugin Directory

Changeset 2210096


Ignore:
Timestamp:
12/11/2019 12:28:44 PM (6 years ago)
Author:
mardellme
Message:

Update to version 1.0.6 from GitHub

Location:
dispatch-countdown
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dispatch-countdown/tags/1.0.6/dispatch-countdown.php

    r2209562 r2210096  
    1313 * Plugin Name:       Dispatch Countdown
    1414 * Description:       Displays x hours left for same day dispatch on WooCommerce shop pages.
    15  * Version:           1.0.4
     15 * Version:           1.0.6
    1616 * Author:            Andy Mardell
    1717 * Author URI:        mardell.me
     
    3232 * Start at version 1.0.0 and use SemVer - https://semver.org
    3333 */
    34 define( 'DISPATCH_COUNTDOWN_VERSION', '1.0.4' );
     34define( 'DISPATCH_COUNTDOWN_VERSION', '1.0.6' );
    3535
    3636/**
     
    6666
    6767}
     68
     69/**
     70 * Run the plugin
     71 */
    6872dispatch_run_countdown();
  • dispatch-countdown/tags/1.0.6/includes/class-dispatch-countdown.php

    r2209515 r2210096  
    5858
    5959    /**
     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    /**
    6069     * Define the core functionality of the plugin.
    6170     *
     
    152161
    153162        $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' );
    158164        $this->loader->add_action( 'wp_ajax_nopriv_get_countdown', $plugin_public, 'get_countdown' );
    159165        $this->loader->add_action( 'wp_ajax_get_countdown', $plugin_public, 'get_countdown' );
    160166
     167        self::$public_instance = $plugin_public;
     168
    161169    }
    162170
     
    209217    }
    210218
     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
    211231}
  • dispatch-countdown/tags/1.0.6/public/class-dispatch-countdown-public.php

    r2209171 r2210096  
    9595    public function display_countdown() {
    9696
     97        if ( ! $this->product ) {
     98            $this->set_product();
     99        }
     100
    97101        do_action( 'dispatch_countdown_before_display_countdown' );
    98102
  • dispatch-countdown/tags/1.0.6/readme.txt

    r2209562 r2210096  
    55Tested up to: 5.3
    66Requires PHP: 5.6
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.6
    88License: GPLv3 or later License
    99URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    29292. Backend view
    3030
     31== Frequently Asked Questions ==
     32
     33= How do I move the countdown? =
     34
     35The countdown must be called at a point where `global $product` is available, so
     36make sure to call this plugin after WooCommerce has loaded. To move the
     37countdown, you can remove the action and then add it back wherever you want:
     38
     39```
     40/**
     41 * Move dispatch countdown
     42 */
     43function 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}
     48add_action( 'init', 'your_theme_move_dispatch_countdown' );
     49```
     50
     51Replacing `your_theme_before_main_container` with whichever hook you wish
     52
    3153== 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
    3267
    3368= 1.0.2 =
  • dispatch-countdown/tags/1.0.6/vendor/autoload.php

    r2209562 r2210096  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0::getLoader();
     7return ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getLoader();
  • dispatch-countdown/tags/1.0.6/vendor/composer/autoload_real.php

    r2209562 r2210096  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0
     5class ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader'));
    2525
    2626        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    2828            require_once __DIR__ . '/autoload_static.php';
    2929
    30             call_user_func(\Composer\Autoload\ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0::getInitializer($loader));
     30            call_user_func(\Composer\Autoload\ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getInitializer($loader));
    3131        } else {
    3232            $map = require __DIR__ . '/autoload_namespaces.php';
  • dispatch-countdown/tags/1.0.6/vendor/composer/autoload_static.php

    r2209562 r2210096  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0
     7class ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    2424    {
    2525        return \Closure::bind(function () use ($loader) {
    26             $loader->prefixLengthsPsr4 = ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0::$prefixLengthsPsr4;
    27             $loader->prefixDirsPsr4 = ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0::$prefixDirsPsr4;
     26            $loader->prefixLengthsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixLengthsPsr4;
     27            $loader->prefixDirsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixDirsPsr4;
    2828
    2929        }, null, ClassLoader::class);
  • dispatch-countdown/trunk/dispatch-countdown.php

    r2209562 r2210096  
    1313 * Plugin Name:       Dispatch Countdown
    1414 * Description:       Displays x hours left for same day dispatch on WooCommerce shop pages.
    15  * Version:           1.0.4
     15 * Version:           1.0.6
    1616 * Author:            Andy Mardell
    1717 * Author URI:        mardell.me
     
    3232 * Start at version 1.0.0 and use SemVer - https://semver.org
    3333 */
    34 define( 'DISPATCH_COUNTDOWN_VERSION', '1.0.4' );
     34define( 'DISPATCH_COUNTDOWN_VERSION', '1.0.6' );
    3535
    3636/**
     
    6666
    6767}
     68
     69/**
     70 * Run the plugin
     71 */
    6872dispatch_run_countdown();
  • dispatch-countdown/trunk/includes/class-dispatch-countdown.php

    r2209515 r2210096  
    5858
    5959    /**
     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    /**
    6069     * Define the core functionality of the plugin.
    6170     *
     
    152161
    153162        $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' );
    158164        $this->loader->add_action( 'wp_ajax_nopriv_get_countdown', $plugin_public, 'get_countdown' );
    159165        $this->loader->add_action( 'wp_ajax_get_countdown', $plugin_public, 'get_countdown' );
    160166
     167        self::$public_instance = $plugin_public;
     168
    161169    }
    162170
     
    209217    }
    210218
     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
    211231}
  • dispatch-countdown/trunk/public/class-dispatch-countdown-public.php

    r2209171 r2210096  
    9595    public function display_countdown() {
    9696
     97        if ( ! $this->product ) {
     98            $this->set_product();
     99        }
     100
    97101        do_action( 'dispatch_countdown_before_display_countdown' );
    98102
  • dispatch-countdown/trunk/readme.txt

    r2209562 r2210096  
    55Tested up to: 5.3
    66Requires PHP: 5.6
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.6
    88License: GPLv3 or later License
    99URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    29292. Backend view
    3030
     31== Frequently Asked Questions ==
     32
     33= How do I move the countdown? =
     34
     35The countdown must be called at a point where `global $product` is available, so
     36make sure to call this plugin after WooCommerce has loaded. To move the
     37countdown, you can remove the action and then add it back wherever you want:
     38
     39```
     40/**
     41 * Move dispatch countdown
     42 */
     43function 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}
     48add_action( 'init', 'your_theme_move_dispatch_countdown' );
     49```
     50
     51Replacing `your_theme_before_main_container` with whichever hook you wish
     52
    3153== 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
    3267
    3368= 1.0.2 =
  • dispatch-countdown/trunk/vendor/autoload.php

    r2209562 r2210096  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0::getLoader();
     7return ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getLoader();
  • dispatch-countdown/trunk/vendor/composer/autoload_real.php

    r2209562 r2210096  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0
     5class ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInit553ce83b1740f79d5232faf4cb96deb0', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit4802a24ea5e8fa98f6f9dfe3c0e88f91', 'loadClassLoader'));
    2525
    2626        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    2828            require_once __DIR__ . '/autoload_static.php';
    2929
    30             call_user_func(\Composer\Autoload\ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0::getInitializer($loader));
     30            call_user_func(\Composer\Autoload\ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::getInitializer($loader));
    3131        } else {
    3232            $map = require __DIR__ . '/autoload_namespaces.php';
  • dispatch-countdown/trunk/vendor/composer/autoload_static.php

    r2209562 r2210096  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0
     7class ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    2424    {
    2525        return \Closure::bind(function () use ($loader) {
    26             $loader->prefixLengthsPsr4 = ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0::$prefixLengthsPsr4;
    27             $loader->prefixDirsPsr4 = ComposerStaticInit553ce83b1740f79d5232faf4cb96deb0::$prefixDirsPsr4;
     26            $loader->prefixLengthsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixLengthsPsr4;
     27            $loader->prefixDirsPsr4 = ComposerStaticInit4802a24ea5e8fa98f6f9dfe3c0e88f91::$prefixDirsPsr4;
    2828
    2929        }, null, ClassLoader::class);
Note: See TracChangeset for help on using the changeset viewer.