Title: Dispatch Countdown
Author: mrdl
Published: <strong>2019 年 12 月 10 日</strong>
Last modified: 2019 年 12 月 17 日

---

搜索插件

![](https://ps.w.org/dispatch-countdown/assets/banner-772x250.png?rev=2209269)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/dispatch-countdown/assets/icon-256x256.png?rev=2209269)

# Dispatch Countdown

 作者：[mrdl](https://profiles.wordpress.org/mardellme/)

[下载](https://downloads.wordpress.org/plugin/dispatch-countdown.1.0.7.zip)

 * [详情](https://cn.wordpress.org/plugins/dispatch-countdown/#description)
 * [评价](https://cn.wordpress.org/plugins/dispatch-countdown/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/dispatch-countdown/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/dispatch-countdown/#developers)

 [支持](https://wordpress.org/support/plugin/dispatch-countdown/)

## 描述

Specify a time to show (and start) the count down, and an end time to count down
to.

Ideal for displaying a message such as “For same day dispatch, order within 1h 37m”.

## 屏幕截图

 * [[
 * Frontend view
 * [[
 * Backend view

## 安装

This section describes how to install the plugin and get it working.

 1. Upload the plugin files to the `/wp-content/plugins/dispatch-countdown` directory,
    or install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Use the WooCommerce->Settings->Product Settings->Dispatch Countdown screen to configure
    the plugin

## 常见问题

  How do I move the countdown?

The countdown must be called at a point where `global $product` is available, so

make sure to call this plugin after WooCommerce has loaded. To move the countdown,
you can remove the action and then add it back wherever you want:

    ```
    /**
     * Move dispatch countdown
     */
    function your_theme_move_dispatch_countdown() {
        // Check the class exists
        if ( ! class_exists( 'Dispatch_Countdown' ) ) {
            return;
        }

        // Get the current instance
        $dispatch_countdown = Dispatch_Countdown::get_public_instance();

        // Remove the action
        remove_action( 'woocommerce_before_single_product', array( $dispatch_countdown, 'display_countdown' ) );

        // Add the action back where you like
        add_action( 'your_theme_before_main_container', array( $dispatch_countdown, 'display_countdown' ) );
    }
    add_action( 'init', 'your_theme_move_dispatch_countdown' );
    ```

Replacing `your_theme_before_main_container` with whichever hook you wish

  How do I change the HTML output?

There are a few filters available to override certain parts of the output. The
 
main filter is `dispatch_countdown_content` and can be used as follows:

    ```
    /**
     * Change countdown HTML output
     *
     * NOTE: You must include an element with the id of dispatch-countdown__time`
    ```

* as javascript uses this to update the countdown.
 */ function your_theme_dispatch_countdown_content(
$html, $wording, $product, $countdown ) { // Add the wording $countdown_html = esc_html(
$wording ); // Add the element for js to update – be sure to include the product
ID as shown $countdown_html .= ‘ ‘; // Add the countdown text $countdown_html .=
esc_html( $countdown ); // Close the countdown element $countdown_html .= ”;

    ```
    return $countdown_html;
    ```

}
 add_filter( ‘dispatch_countdown_content’, ‘your_theme_dispatch_countdown_content’,
10, 4 );`

## 评价

![](https://secure.gravatar.com/avatar/3fc0a7b6069720689a32c5f2476bbb8089902b4422e9d15545c0ad4513e365ca?
s=60&d=retro&r=g)

### 󠀁[Simple and Effective](https://wordpress.org/support/topic/simple-and-effective-1219/)󠁿

 [kyarauk](https://profiles.wordpress.org/kyarauk/) 2020 年 11 月 22 日

I was a bit doubtful in installing this plugin given it hasn’t got any reviews or
many installations, but I was wrong. I needed something a lightweight way to offer
a dispatch message on my product pages and after testing it locally with no issues,
I added it to my site and so far it has worked as expected. The code supplied to
move the message doesn’t seem to work, but I am happy having it where it is.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/dispatch-countdown/reviews/)

## 贡献者及开发者

「Dispatch Countdown」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ mrdl ](https://profiles.wordpress.org/mardellme/)

[帮助将「Dispatch Countdown」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/dispatch-countdown)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/dispatch-countdown/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/dispatch-countdown/)，或通过[RSS](https://plugins.trac.wordpress.org/log/dispatch-countdown/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/dispatch-countdown/)。

## 更新日志

#### 1.0.7

 * Update docs
 * Add POT file for translations
 * Adds filters to main output

#### 1.0.6

 * Allow dispatch countdown hook to be overridden
 * Update documentation with how to move

#### 1.0.5

 * Remove some dist files

#### 1.0.4

 * No changes – deployment tests only

#### 1.0.3

 * No changes – deployment tests only

#### 1.0.2

 * Added icons
 * Added screenshots

#### 1.0.1

 * Updated readme.txt to adhere to WordPress standards

#### 1.0.0

 * Initial release.

## 额外信息

 *  版本 **1.0.7**
 *  最后更新：**6 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 4.0 或更高版本 **
 *  已测试的最高版本为 **5.3.21**
 *  PHP 版本 ** 5.6 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/dispatch-countdown/)
 * 标签
 * [countdown](https://cn.wordpress.org/plugins/tags/countdown/)[dispatch](https://cn.wordpress.org/plugins/tags/dispatch/)
   [woocommerce](https://cn.wordpress.org/plugins/tags/woocommerce/)
 *  [高级视图](https://cn.wordpress.org/plugins/dispatch-countdown/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/dispatch-countdown/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/dispatch-countdown/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/dispatch-countdown/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/dispatch-countdown/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/dispatch-countdown/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/dispatch-countdown/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/dispatch-countdown/reviews/)

## 贡献者

 *   [ mrdl ](https://profiles.wordpress.org/mardellme/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/dispatch-countdown/)