- Contributors: thomas.ebert
- Tags: calendar, events, theme, template
- Requires at least: 4.7.2
- Tested up to: 4.9.8
- Stable tag: trunk
- License: GPLv2 or later
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
- Donate link: https://paypal.me/teonline
Note: This a BETA plugin. A Really Simpleβ’ Calendar with beautiful default templates and a way to create your own themes for your events.
Note: This is a BETA plugin. This plugin is not ready for production websites. If you don't know what βbetaβ means, you should consider looking for a different plugin for the time beeing. If you want to test this plugin and give feedback on the currently implemented functionality, you're more than welcome to post in the GitHub issue tracker!
When finished, this is supposed to be a really simple calendar plugin with beautiful default templates and the possibility for developers to create themes for the eventlists that can be shipped with WordPress themes.
- Visual calendar to create events
- Two default templates
- A widget for displaying events
- A shortcode for displaying events
- Possibility to use a custom php-file in your themes directory as a template
- Events support
- Event title
- Start/Begin date and time
- End date and time
- All day parameter that omits times
- Specify end parameter that omits the end
- Location
- Description
- Use a default calendar or create as many calendars as you want (distinguished by color)
- Translations: English, German, Dutch (not checked by native-speaker)
- Use external calendars as read-only for displaying (ical)
- Have a UI for specifying which template to use (dropdowns and display names for templates)
- Event features
- Custom fields
- Repeatable events (just like in every normal calendar)
Use the UI in the Widgets area to add a calendar to a sidebar and set the options. The options are similar to the options for the shortcode (see below).
Use the shortcode like this: [calendar num_events="5" template="my_template_file_in_theme_directory.php" archive="false" calendar="calendar's slug"]
All options are optional.
num_events
β the number of events to display.template
β the name of the template file in your theme's directory. Defaults todefault
which is the template shipped with this plugin.archive
β whether or not to display only events from the past.calendar
β the calendar to use for displaying events. Multiple comma separated.filter
β a search term to filter events with. Only matching will be shown.
By default, REST API access to calendars and events is enabled from (including) version 0.4.0 and upwards. Standard WordPress endpoints are used. You can add custom attributes for your own purposes. Take a look at the specific chapter in the Developer handbook.
Calendars are a custom term
and events are represented by a custom post_type
.
All standard limitations and usages for the WordPress REST API apply, be aware of that. Example: Responses are limited to a certain number of items. Use the X-WP-Total
header to determine how many entries exist and use the page
query parameter to browse through the paginated entries.
Replace https://example.org
with your own WordPress URL in the examples below.
To get a list of calendars from the WordPress REST API, try the following endpoint:
(GET) https://example.org/wp-json/wp/v2/calendars
.
Attributes. The field name
is your calendar's name. You can use the field id
to fetch events only for a specific calendar or for a list of calendars.
After we got details about the calendars from the API, we can use this information to retrieve events for specific calendars.
Use the endpoint (GET) https://example.org/wp-json/wp/v2/events?calendars=1,2
to fetch events for the calendars that have assigned the ids 1
and 2
. You can also just use one calendar-id.
To retrieve all events from all calendars, use this endpoint https://example.org/wp-json/wp/v2/events
.
Attributes. The plugin adds one custom attribute to each event in the reponse called event_details
.
This attribute is an object with values like location
, begin
, end
, begin_date
, end_date
, begin_time
, end_time
, all_day
, has_end
. The end
, end_date
and end_time
attributes will be null
, if has_end
is false
. The begin_time
and end_time
attributes will be null
, if all_day
is true
.
Use the title.rendered
and content.rendered
attributes, that are added by default to the response, to get the title and description (content) for the specific event.
Time ranges. To fetch events within certain time ranges, we can use the custom query fields begin_after
and end_before
, as well as the default fields order
and per_page
. The fields begin_after
and end_before
are inclusive, meaning that the date you specify (format: YYYY-MM-DD
) will be included in the results on both ends of the boundary.
Examples:
- Fetching events between two dates
Assuming we want the events between the 1st of January 2011 and the 31st of July 2011. The start and end of our boundaries can be specified in the query attributes begin_after
and end_before
. To get the earliest events first instead of the latest events, we use order
=asc
.
(GET) https://example.org/wp-json/wp/v2/events?begin_after=2011-01-01&end_before=2011-07-31&order=asc
- Fetching 3 events after specific date
Assuming we just want the 3 first events in the year 2019. Specifying the begin_after
will get us all events after that date (including the date itself). Assigining 3
to the per_page
parameter, reduces our results to 3 entries.
(GET) https://example.org/wp-json/wp/v2/events?begin_after=2019-01-01&order=asc&per_page=3
For an example of how to create a template see the files in the templates
folder of the plugin. The template functions are inspired by the core WordPress functions you can use for posts and pages.
Detailed descriptions for the functions will follow. All functions can be used with echo (the_...) or silently (get_...).
Get the event begin in a given format. Format string uses the format seen here: https://codex.wordpress.org/Formatting_Date_and_Time
Get the weekday of the event begin.
Get the short form date of the event begin.
Get the year of the event begin.
Get the time of the event begin.
Get the event end in a given format. Format string uses the format seen here: https://codex.wordpress.org/Formatting_Date_and_Time
Get the weekday of the event end.
Get the short form date of the event end.
Get the year of the event end.
Get the time of the event end.
Get the location of the event.
Know if the event is an allday-event.
Know if the event has an end specified.
This plugin currently uses the following external libraries:
- FullCalendar
- Rome by NicolΓ‘s Bevacqua
Use the GitHub Updater to install the plugin.
Download the zip file and put the contents into your wp-content/plugins folder.
No frequently asked questions, yet. If you have a question, open an issue on GitHub...
Screenshots are to follow.
- Attempt to fix an issue with a constructor in the dependency Carbon when running sync of calendars on WPCron
- Update Full Calendar to 3.10.2 to be compatible with jQuery 3.5.0
- Bundle moment-with-locales with plugin, because it is no longer included in Full Calendar
- Remove Outlook compatibility hotfix, because it doesn't actually do any good
- Fix validation error when creating an event starting and ending on the same day but specifying times
- Add Outlook compatibility by temporarily fixing timezone issues with Outlook-generated events
- Update composer dependencies
- Remove registration of
events
custom-post-type namespace - Catch when
last_modified
is not set on ical event
- Add option to ignore
modified-date
field in iCal feed, to be compatible with Nextcloud.
- Add
filter
property to Shortcode. Enables you to only show events that contain a specific search string.
- REST API: Add support for the WordPress JSON API. You can now fetch calendars and events through the API, and filter and sort the result.
- Secure Ajax request with nonces.
- Add basic support for Advanced Custom Fields in calendar view.
- Fixes to the modal event editor
- Additions to the hotfix from 0.3.9.1
- Hotfix: Fix accidental call to
get_field
of ACF instead ofget_term_meta
. - Enhancement: List View β Add view switch. Now we can also see and remove trashed events.
- ICAL β Fix recurring events apparently can also have no
RRULE
, but aRECURRENCE_ID
instead. Account for that while checking uid of event. - LIST VIEW β Enhancements to list view.
- Fix pagination not working
- Add sorting by column and default order
- Fix ical field caption in calendar settings
- ICAL β Fix allday events could not be updated to be timed events.
- Update composer ical parser library.
- ICAL β Fix event specific timezone was used for UTC time. Fix repeating events all had the same uid.
- Fix allday events with set start and begin will be displayed incorrectly.
- Fix allday events have the next day as end day, because they are saved as 24 hours long.
- Always set external events to have end, because otherwise it won't be saved for multi-day allday events.
- Fix problem with calendar range format when fetching events.
(skipped)
- Switch WP Cron to hourly jobs fetching external events (instead of twicedaily).
- Fix external calendar not editable.
- Also add p tag around empty state message.
- Make default template structure a bit more concise and add translations
- Breaking change: Fixed: Times were not saved in UTC before, now they are. All your old dates will unfortunately inevitable off, if your're not using UTC anyways.
- Fixed: Error in JavaScript when event description was
null
. - Fixed: JS Error on other WP admin pages.
- Added: The Readme is now readable and has some considerable emoji-explosion.
- Added: You can now use external iCal feeds as a read-only calendar and display events from the feed π.
- Added: Updated translations and translation for DE_formal.
- Fixed: Shortcode display position was broken.
- Fixed: When no calendar was configured, the widget didn't show the default calendar.
- Fixed: Data inconsistencies in edit dialog. Making sure you edit the correct data and don't have to start over.
- Added: Switch between WordPress-style list of events and JavaScript based calendar view.
- Added: Nice menu icon from dashicons.
- Added: Neat JavaScript enhancements for the WordPress style event edit screen.
- Fixed: Visual improvements to add-event modal.
- Fixed: Fix calendar data not loading correctly due to too much sanitization.
- Fixed: Template can be used multiple times now.
- Added: Color setting for calendars.
- Added: Choose calendar to save event in.
- Added: Chosse calendar for display in widget.
- Added: Use multiple calendars and have one default calendar.
- Added: Enable templating with files from themes directory.
- Initial version.