开发者 | gsarig |
---|---|
更新时间 | 2023年11月6日 00:47 |
捐献地址: | 去捐款 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 6.4 |
版权: | GPLv2 or later |
[timelord]
shordcode. Here are some common examples, supposing that present day is on April 2015:
[timelord from="2016-01"]SOME CONTENT[/timelord]
would output "SOME CONTENT" only when January 2016 comes.[timelord to="2016-01"]SOME CONTENT[/timelord]
would output "SOME CONTENT" until January 2016 and then it would remove it.[timelord from="2015-04-01" to="2016-04-01" every="1 day"]SOME CONTENT[/timelord]
would output "SOME CONTENT" every other day until April 2016.[timelord from="2015-04-01" to="2016-04-01" every="Monday"]SOME CONTENT[/timelord]
would output "SOME CONTENT" every Monday until April 2016.[timelord to="2014-01" del="yes"]SOME CONTENT[/timelord]
would output SOME CONTENT
(check screenshot for an example of what the user would actually see in the frontend).[timelord from="2015-01" to="2016-01"]SOME CONTENT[/timelord]
would output "SOME CONTENT" from January 2015 to January 2016.[timelord mode="hide" from="2015-01" to="2016-01"]SOME CONTENT[/timelord]
would output "SOME CONTENT" every other time except from January 2015 to January 2016.[timelord year="1980"]
would output "35".[timelord year="1980" ordinal="yes"]
would output "35th".
tag instead of removing it when expires.Shortcode parameters include the following:
[timelord from="2016-4-1 20:10:00"]SOME CONTENT[/timelord]
will show the text "SOME CONTENT" on April 1st of 2016 at 20:10). If you don't care about so much specificity, you can omit values from right to left. For example, you could just add from="2016-04" if you want to show your content as soon as April 2016 comes.[timelord from="2015-04-01" to="2016-04-01" every="1 day"]SOME CONTENT[/timelord]
would output "SOME CONTENT" every other day until April 1st. This parameter can accept a date with relative parts like for example every="12 hours", every="2 days", every="1 hour" etc. (See examples). Also, you can use the day's' name to show content on a specific day of the week using, for example every="Monday". NOTE: the "every" parameter cannot be combined with the other parameters that follow - it will just show or hide the content depending on the given interval.
tag in order to mark it as "erased". For example, [timelord to="2016-4-1" del="yes"]SOME CONTENT[/timelord]
would output SOME CONTENT
(check screenshot for an example of what the user would actually see in the frontend).[timelord from="2016-04" from_msg="Content will be live in: "]SOME CONTENT[/timelord]
would output "Content will be live in 12 months".[timelord year="1980"]
will output "35". If the year is set to the future, it will output the years remaining. for example, [timelord year="2020"]
would output "5".[timelord year="1980" ordinal="yes"]
would output "35th".[timelord from="2016-04" to="2017-04" message="Content not yet available. " from_msg="Time to be up: " to_msg="Will expire: "]SOME CONTENT. [/timelord]
would output the following:
[timelord mode="hide" from="2016-04" to="2017-04"]SOME CONTENT[/timelord]
would hide the content on the given timeframe and show it at the rest of the time.