WP Manifestindependent plugin directory
manifest / utilities / wp-time

Time Dependent Elements

JavaScript init elements by Time

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/ismitka/wp-time/archive/refs/heads/main.zip
Updates itself. It ships its own updater (Update URI header), so new versions appear under Dashboard → Updates.

Time - WordPress Plugin

JavaScript tool for conditionally displaying an element depending on time.

Example:

Show current time

[wp-time format="h:MM:ss"]
<span data-time="h:MM:ss"></span>

Detail documentation for Date/Time format at https://github.com/felixge/node-dateformat

Conditional display

[wp-time-on on="0/10 * * * * *" off="5/10 * * * * *"]
Show on each 0s (0s 10s 20s...) and Hide on each 5s (5s 15s 25s...) 
<span data-on-time='{"on":"0/10 * * * * *","off":"5/10 * * * * *"}'>Show 0-5s</span>
<span data-on-time='{"on":"0/10 * * * *","off":"5/10 * * * *"}'>Show 0-5m</span>
<span data-on-time='{"on":"5/10 * * * *","off":"10/10 * * * *"}'>Show 5-10m</span>

Detail documentation for Cron Expression at https://github.com/harrisiirak/cron-parser#readme

Compose / Test Crom Expression at https://crontab.guru/

Update dependencies

npm install

Compile JS

pnpm run build

Create plugin archive

./compress.sh