[wordpress插件] Days Until直到天数

wordpress 插件 文章 2020-04-13 06:50 503 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Originally I used the “Countdown Timer” plugin written by Andrew Ferguson to accomplish what I wanted,

最初,我使用了安德鲁·弗格森(Andrew Ferguson)编写的“倒数计时器”插件来实现我想要的功能,

however, his implementation to output in just days also outputted extraneous text that I was

但是,他在几天内实现的输出也输出了我当时的无关紧要的文字

not interested in. On top of that, the actual count algorithm was flawed.

不感兴趣。最重要的是,实际计数算法存在缺陷。

Rather than hack

而不是hack

this plugin to pieces to get the output I needed, I decided to just roll my own.

将此插件拼凑起来以获得所需的输出,我决定自己动手制作。

This is a bare bones, no-frills plugin since this is my first attempt at it.

这是一个简单的,简洁的插件,因为这是我第一次尝试。

This means no

这意味着没有

fancy options or configuration screens.

精美的选项或配置屏幕。

To use the plugin, simply install it and then use the following shortcode to output the number

要使用该插件,只需安装它,然后使用以下短代码输出数字

of days until a given date in its place:

距指定日期为止的天数:

[days_until date=”SPECIFIC DATE”]

[days_until date =“具体日期”]

Where “SPECIFIC DATE” can be any text that that PHP’s strtotime function can understand.

“具体日期”可以是PHP的strtotime函数可以理解的任何文本。

安装步骤

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

本节介绍如何安装插件并使其正常工作。

e.g.

例如

    1. Upload daysuntil.php to the /wp-content/plugins/ directory
    2. daysuntil.php 上载到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Place [days_until date="SPECIFIC DATE"] in your content
    6. 在您的内容中放入 [days_until date =“具体日期”]

下载地址
https://downloads.wordpress.org/plugin/days-until.1.1.zip
-EOF-

AI助手支持GPT4.0