京都大学東南アジア地域研究研究所 情報処理室

Google Calendar List View

The plugin is to create a shortcode for displaying the list view of a public Google Calendar.  If you want to use a multi-Google Calendar later,  you can specify them in the shortcode options.

*For support, please use the following forum: https://wordpress.org/support/plugin/list-view-google-calendar/
*For troubleshooting information, please refer to the following Google document: https://docs.google.com/document/d/1Z0oL-4k5_xEp7uIY7aISPdCatEq95khXOCWlEZxeC9I/edit?usp=sharing

Google Calendar List View

Latest version

Shortcode

If you only use a public Google calendar, you can use the setting values of "Google Calendar API Key" and "Google Calendar ID".If you want to use multi Google Calendar later,  you can specify them in the shortcode options. Version 4.0 supports the multi Google Calendars. If you want to add 2 or more Google Calendars, set g_id_*** shortcode option(for the first calendar, g_id must be specified). You can set an unique key as ***. If you want to set an Google Calendar API key on each Google Calendar ID, set g_api_key_*** with g_id_***.
In case of using the default values, please put the shortcode as Text mode because it needs to use <ul> tag. If you use "p" value on html_tag, you can use Visual mode.

Or if you want to customize the output values, please use the following hook.

Options on Shortcode (Version 7.2.0)

The shortcode is to display the list (default 10 items) of public Google Calendars from now (start_date)  to the future.  The default date format is YYYY.MM.DD. The sort is the ascending on start_date.

The following shortcode option is priority than setting values.

How to create Google Calendar API Key

I think I don’t need to explain it because above document is very nice! Please keep in mind that there is query limitation (Google Calendar API Usage Limits).

How to find Google Calendar ID

For more information, see the following Google document ‘Specific Usage of Google Calendar List View’.
https://docs.google.com/document/d/1WFNLlzD9Wt9_eNv3SVs_0KVc3X6jMitpcCgCbUJq2-I/edit?usp=sharing

What’s kind of settings?

There are settings on "Google Calendar List View Settings" in the setting menu of the administration dashboard.

Google Calendar API Settings

Output Settings

Hooks & Notice

How to use Hooks

The following codes were tested on functions.php in the theme.
Please keep in mind that the output data can be changed from the following hooks.
Therefore, please pay attention the security countermeasure.

 

Array for a Hook

Since version 5.9, the reference of the original resources in Google Calendar event are available from the hook. If you want to refer the resources, you specify add_filter( 'lvgc_each_output_data', 'function name', 10, 3 ); and function function-name ($out, $out_atts, $gc_value) .

$out_atts use in each hook.
if you use "extract($out_atts);", you can use the following variables.

 

lvgc_each_output_data

The hook can change the output data in each item.

Default output is as below:

Let’s code the above output data on a hook.

For more information, please refer to the following “For example (lvgc_each_output_data)” on p. 3 of the following Google Document ‘How to use “Google Calendar List View” in detail’.
https://docs.google.com/document/d/1WFNLlzD9Wt9_eNv3SVs_0KVc3X6jMitpcCgCbUJq2-I/edit?usp=sharing

Notice: coding timezone

WordPress forcibly processes the date as UTC timezone. In other words, "date" and "i18_date" function don’t work on  WordPress if you want to code other timezone except UTC.  Therefore, you need to use WordPress date functions "current_time" and "get_date_from_gmt" instead of date and i18_date.

Get current time & convert date format

Convert date format: get_date_from_gmt

The following example is to convert $start_date to the setting timezone on WordPress.

Change history (past version)

August 24, 2024 Fixed the documentation for version 7.2.1.
November 21, 2021 Fixed the documentation for version 6.6.
April 21, 2021 Fixed the documentation for version 6.5.
April 18, 2021 Fixed the documentation for version 6.4, 6.4.1.
April 16, 2021 Fixed the documentation for version 6.3.
March 16, 2021 Fixed the documentation for version 6.1.
March 15, 2021 Fixed the documentation for version 6.0.
August 25, 2017  Fixed the documentation for version 3.0.
August 24, 2017  Fixed the documentation for version 2.2.
July 21, 2017 Fixed the documentation for version 2.1.
June 26, 2017  Fixed the documentation for version 2.0.
June 25, 2017 @kimipooh

 

 

 

Exit mobile version