WP Manifestindependent plugin directory
manifest / utilities / wp-time

Time Dependent Elements

JavaScript init elements by Time

by Ivan Smitka · github.com/ismitka/wp-time · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/ismitka/wp-time/archive/refs/heads/main.zip

Declares an update source (https://www.smitka.net/wp-plugin/wp-time), so updates arrive through the plugin's own updater.

Readme

wp-time

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

Read the full README on GitHub →