
內容簡介
保持日期時間相關文本的相關性。例如,「我已經工作了 x 年。」在一年內就過時了。在你的文章中使用 years-since 外掛可以讓「x」保持最新並且使你的內容保持新鮮。
使用方法
在你的文本中,必須使用屬性「y」來提供一個年份,例如:[years-since y=2012]。
你也可以選擇使用「m」來標記月份,「d」來標記日期。如果未在短碼中添加月份和日期,則它們的預設值為「1」。
例如,在「關於我們」頁面上,你可能會寫:
我們已經遠程工作了 [years-since y=2012] ,這使得團隊可以花更多時間旅行和與家人在一起。
或者,如果你想在特定週年紀念日上更新時間範圍,你可以寫像這樣的句子:
我 [years-since y=1990 m=5 d=16] 歲了。
1.3.2
修正了 or 為 ||
1.3.1
為外掛添加命名空間以避免 PHP 衝突。
修復當使用 [years-since-gb] 時會破壞 HTML 的問題。
測試 WP 版本 5.6 的兼容性。
1.3.0
添加了允許以天、月、週為單位的功能,當時間少於一年時使用它們代替「0 年」。
1.2.0
添加了對 Gutenberg 的支持。
1.1.0
在說明文件中加入了對 Gutenberg 的說明。
1.0.1
翻譯了返回的錯誤信息。
添加了一個短碼參數,用於屏蔽「年」或「年」文本。
1.0.0
初始化。
外掛標籤
開發者團隊
② 後台搜尋「Years Since – Timeless Texts」→ 直接安裝(推薦)
原文外掛簡介
Keep date time related texts relevant. “I have worked for x years.” becomes outdated within a year. Years since keeps “x” current in your posts and allow your content to age well.
Usage
A year must be provided in your text by the attribute “y” such as [years-since y=2012].
As an option, Months by referencing “m” and day by using “d”. Months and day default to “1” if not added in the shortcode.
For example, on an “About” page text, you might have something like:
We’ve worked remotely for [years-since y=2012], which has allowed the team to spend more time traveling and spending time with family.
Or, if you wanted to update a time span on a particular anniversary, you could do something like:
I’m [years-since y=1990 m=5 d=16] old.
More attributes
html
Add specific HTML tag to the calculation with the html attrribute e.g.
[years-since y=1990 html=span] will wrap the output in a span tag.
text
Add a text attribute with value false i.e.
[years-since y=1990 text=false] will remove the text years from the calculation.
It will output 23 instead of 23 years.
1.4.1
Fix: Add proper escaping for the shortcode input.
1.4.0
Fix: Breaking month and day output.
Add: Testing for WP 6.5.2
Add: Require PHP 8.2.0
Add: Require PHP 7.4
Add: Function arguments and Return Type hinting.
Add: A testing framework with pest with CI.
Fix: Deprecate Editor poylfill function for the block editor.
1.3.5
Fix: Breaking change HTML Default argument paragraph html attribute as “p” for the shortcode output.
1.3.4
Fix: Restore minus text format for the calculations.
Add: Translations file build + .pot.
Add: Default attributes for the shortcode.
New: HTML Default argument paragraph html attribute as “p” for the shortcode output.
1.3.3
Fix: Time calculations and messaging.
Test: WP 6.3.1.
Test: PHP 8.2.10.
1.3.2
Fix or to ||
1.3.1
Namespace the plugin to avoid PHP conflicts.
Fix the breaking html when [years-since-gb] is used.
Test WP version compatibility for 5.6.
1.3.0
Add functionality to allow for days, months, weeks instead of 0 years when time is less than a year.
1.2.0
Add Gutenberg support
1.1.0
Add Gutenberg note to readme.
1.0.1
Translate returned errors.
Shortcode parameter to suppress “year” and “years” text.
1.0.0
Initial creation.
