Event Oraniser
イベントカレンダーを作れるWordpress公式プラグイン。
https://ja.wordpress.org/plugins/event-organiser/
ただ、デフォルトだと日付の表示が1月 2020年
とか25-01-2020
になってるので馴染みのある形式にフォーマットして取得します。
日付の表示を修正
修正するファイルは下記
/wp-content/plugins/event-organiser/includes/event-organiser-event-functions.php
1384行目くらい
'titleformatmonth' => 'F Y年'
↓
'titleformatmonth' => 'Y年 F'
イベント日の取得方法
それぞれの日付は下記の関数で取得します。
開始日:eo_get_schedule_start()
終了日:eo_get_the_end()
eo_get_schedule_last()
というのもあるらしく引っかかりました。。。
パラメータに応じてフォーマットしてくれます。
event-organiser-event-functions.php
をイジるよりこのほうが良さそうですね。
<?php echo eo_get_schedule_start('Y年n月j日'); ?>
2020年1月21日
Googleカレンダーっぽい感じで使えそうなところが ◯
イベントカレンダー作るときはお世話になりそうなプラグインですが
毎回「これどうやるんだっけ?」ってなりそうなので備忘として残しておきます。