內容簡介
這是一個簡短代碼,可返回指定日期至今的年份或天數。
使用方式:[we_time_since y=Y m=M d=D type="T"]
其中:
* Y = 所需年份
* M = 月份 (1-12) - 選填。預設為1
* D = 天數 (1-31) - 選填。預設為1
* T = 類型 ("year", "day") - 選填。預設為 "year"
返回:
返回自提供日期至今的年份或天數,如果日期無效/未提供年份,則返回錯誤訊息。
範例
我在 Wedepohl Engineering 工作已經有 [we_time_since y=1998 m=1 d=1] 年了。
我已經開始航海 [we_time_since y=2008 m=4] 年了。
我此行已經 [we_time_since y=2020 m=5 d=5 type="day"] 天了。
動作
before_we_time_since - 進入簡碼時呼叫,傳遞傳遞給簡碼的引數數組。
after_we_time_since - 函数退出之前的呼叫。傳遞簡碼處理的引數數組。
過濾器
we_time_since - 在函數退出時呼叫。傳遞一個字符串,該字符串是簡碼的結果。
活躍貢獻者
Martin Wedepohl (開發)
外掛標籤
開發者團隊
② 後台搜尋「Wedepohl Engineering Time Since」→ 直接安裝(推薦)
原文外掛簡介
Shortcode to return the number of years or days since a certain date.
Usage: [we_time_since y=Y m=M d=D type="T"]
Where:
* Y = the year required
* M = the month (1 – 12) – optional Default = 1
* D = the day (1-31) – optional Default = 1
* T = the type (“year”, “day”) – optional Default = “year”
Returns:
The number of years or days since the supplied date or an error message if the date is invalid / no year supplied
Examples
I have worked at Wedepohl Engineering for [we_time_since y=1998 m=1 d=1] years
I have been sailing for [we_time_since y=2008 m=4] years
I have been on this journey for [we_time_since y=2020 m=5 d=5 type="day"] days
Actions
before_we_time_since - Called upon entry to the shortcode. Passed the array of arguments that are passed to the shortcode.
after_we_time_since - Called just before exit of the function. Passed the processed array of arguments from the shortcode.
Filters
we_time_since Called at exit of the function. Passed a string which is the results of the shortcode.
Active Contributors
Martin Wedepohl (Development)
