WordPress plugin intelligence profile

Time goes by

Switch the display of content based on time using a shortcode. ショートコードで囲んだコンテンツを時間に応じて表示切替できるプラグイン。

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.8
Current version1.2.9.1
WordPress coverageTested up to WordPress 6.8
Minimum stackWP 6.0 · PHP —
Directory statusactive
Last directory update12 Sept 20251y ago
Active installations100Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Time goes by version 1.2.9.1 as active, updated 1y ago and tested up to WordPress 6.8.

Overview

About this plugin

ショートコード [tgb ][/tgb] で囲まれた部分が start_time, end_time, config で指定された時間帯等に表示されるようになるプラグインです。

start_time だけの指定

end_time だけの指定も可能です。

[tgb start_time=”20160101″][/tgb] で囲まれた部分は 2016年1月1日を迎えると表示されます。

[tgb end_time=”20161231″][/tgb] で囲まれた部分は 2016年12月31日になるまで表示されます。

2016年12月31日いっぱい表示したい場合は [tgb end_time=”20161231235959″][/tgb] で囲むか

[tgb end_time=”20170101″][/tgb] で囲むと2017年1月1日担った瞬間表示されなくなります。

より詳細で繰り返しも可能な config パラメータの設定ができるようにしました。

設定は config=”day:1|2|3|4|5,hour:7|8|9|10|11″ のように設定します。

上記の設定は下記のように理解されます。

「毎月1〜5日 の 7〜11時 にだけ表示される」

これに start_time, end_time も絡めて詳細に繰り返しとなる部分を設定することが可能です。

そして複数の設定を一度に行うことができます。パラメータをカンマ区切りで指定できます。

** 複数の設定は記述の順番に実行されます。ただし、任意のパラメータについては最後に実行されます。

** 規定のパラメータ、任意のパラメータ以外のパラメータは無視されます。

config パラメータは下記の設定が出来ます。

[1] hour: 24時表記で設定します。7〜10時という場合は hour:7|8|9(10時台に入ったら表示されない) というように | (vertical line)で区切るようにします。

[2] day: 毎月○日の設定をします。 day:7|8|9|10 とすると 7〜10日というようになります。

[3] week: 毎週○曜日の設定をします。 week:sun|mon|tue とすると日〜火曜日という感じです。一応日本語での設定も受け付けるはずです。 week:火|木|土 など。

[4] month: ○月の設定をします。 month:6|7|8 とすると6〜8月という感じです。季節ごとの表示切り替えができる感じです。

[5] 任意のパラメータ これは

add_filter(‘time_goes_by_judgement’, ‘〜任意のメソッド名〜’, 10, 3);

phpに記述し

任意のメソッド名にて TRUE か FALSE を返却すればそのように表示されます。

そもそも他の判定に依存しないように $flg を引数に入れていますので、そこまでの判定を覆すことも可能です。

$config には任意のパラメータ以外の上記パラメータも入ってきます。 $content にはショートコードで囲まれた部分が入ってますので

様々な利用方法・判定方法が考えられます。

apply_filters( ‘time_goes_by_judgement’, $flg, $configs, $content );

祝日に表示する などは現在のプラグイン自体にはない機能ですが、これを使って実装すると良いでしょう。

例:

[tgb config=”month:1|2|3,day:5|15|25,hour:13|14|15″]1〜3月の 5の付く日は タイムサービスを行っています!!! ただいま13時〜16時までサービスタイム実施中!![/tgb]

・timezone=”Asia/Tokyo” のようにパラメータ指定でタイムゾーンの指定ができます。

このデフォルト値は内部設定のタイムゾーンとなっています。

このデフォルト値は管理画面から変更することが可能です。

その他、この中で利用出来るように[disp_content][disp_title]ショートコードも用意しました。

[disp_content post_id=”xxx”] とすると、投稿IDがxxxのコンテンツを表示します。

[disp_title post_id=”xxx”] とすると、投稿IDのタイトルを表示します。

例:

[tgb start_time=”20160101″ end_time=”20160201″]

[disp_title post_id=”1234″]

[disp_content post_id=”1234″][/tgb]

2016年1月1日から2016年2月1日になるまで(1月31日の間まで)投稿ID:1234のタイトルがh2タグでその下に投稿ID:1234のコンテンツが表示されます。

5)

slug にはスラッグを入れると記事を特定します。(サーバー移転などpost_idが変わるような環境で効果的です。)

status は publish, future, private, draft の中から指定できます。

非公開の状態だったら取得したくない場合などを考慮しました。

無指定の場合はいかなる状態でも取得してきます。

制作:佐藤 毅(さとう たけし) 福岡市南区大橋 ウェブシステム開発 株式会社ジーティーアイ代表

Arbitrary section

A brief Markdown Example

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • content
  • shortcode
  • time
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.8

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.8.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.8
Minimum requirementsWordPress 6.0 · PHP not listed
Update activity12 Sept 20251y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.