Deprecated Stylesheets

dark.css

A theme in dark grays and blacks with light text and dark blue highlighting.

My Calendar > Design > Style Editor – dark.css

inherit.css

These styles provide a minimal degree of styling, allowing most theme defaults to be dominant.

My Calendar > Design > Style Editor – inherit.css

light.css

A light-colored theme almost entirely in whites and light grays with black text.

My Calendar > Design > Style Editor – light.css

my-calendar.css

Default theme for versions 1.5 through 1.8.9. It’s largely in white, light blues and greens, with dark text.

My Calendar > Design > Style Editor – my-calendar.css

refresh.css

Blue and white with gradient effects. Default theme from version 1.9 through 2.2.13.

My Calendar > Design > Style Editor – refresh.css

twentyfifteen.css

Largely grayscale, but supports any combination and order of navigation elements, unlike previous themes. Default theme with version 2.3.24.

My Calendar > Design > Style Editor – twentyfifteen.css

twentyfourteen.css

Largely grayscale, but larger and bolder with more whitespace than other themes. Default theme with version 2.3.

My Calendar > Design > Style Editor – twentyfourteen.css

My Calendar – API

The My Calendar exports API is enabled at My Calendar > Settings > General. This API allows you to generate a CSV, JSON, or iCal formatted export of My Calendar event data.

My Calendar > Settings > General

The API is not enabled by default. Once enabled, you can access it using URL parameters on your site:

http://www.example.com/?my-calendar-api=json&from=2021-02-01&to=2022-01-31

The my-calendar-api parameter is used to set the export format, and accepts json, csv, and ical as options.

Parameters

  • my-calendar-api: format to return, ‘json’, ‘csv’, ‘ical’
  • from: starting date to retrieve, YYYY-MM-DD (default: current date.)
  • to: end date to retrieve, YYYY-MM-DD (default: 7 days from today.)
  • mcat: Category ID to limit by.
  • ltype: Location type to restrict to (keywords: ‘name’, ‘city’, ‘state’, ‘zip’, ‘country’, ‘region’)
  • lvalue: Location value to match against location field type
  • author: Events by author ID
  • host: Events by host ID.
  • search: text search query terms.

Private events are automatically excluded from exports.

Once enabled, the export API is public by default. You can restrict access to the API using your own program logic using the filter mc_api_key.

/**
 * Check for and validate access to the My Calendar exports API.
 *
 * @return bool False to block; true to allow.
 */
function your_api_key() {
	$valid = false;
	// This example assumes the addition of an additional request parameter. However, any logic could be used here.
	if ( isset( $_REQUEST['mc_api_key'] ) ) {
		$valid = your_validate_key( $_REQUEST['mc_api_key'] );
	}

	return $valid;
}
add_filter( 'mc_api_key', 'your_api_key' );

My Calendar Views – Overview

Grid

The grid view is the most traditional calendar layout option. By default, it’s a table with either five or seven columns for the days of the week. Each cell contains headings with the time and title of the events on that day, ordered by start time.

The title can be customized using the Display Settings for “Event title (Grid)”.

Grid view with seven columns, one event opened with minimal details.
Grid view showing seven days

List

The list view is organized the same way as the grid view. Each day is represented by a list item containing the events for that day. The list view has two different interaction options: using the date as a toggle to view the events on that day, or showing the event titles by default, and using the event titles to toggle the details for that event.

The title in list view can be customized using the Display Settings for “Event title (List)”. Enable the event titles view by checking “Show events in list view” under the “List Options” section on the same settings page.

List view showing event titles.
List view without titles. Current day expanded.

Mini/Compact

The mini or compact calendar uses a compact grid like the main grid calendar, using the current date as a toggle to show details for all events on that date.

Mini calendar; nothing expanded.

Script Options

The grid, list, and mini all support two options for interactions: a disclosure widget and a modal. These are configured at Design > Scripts. The screenshots above show the disclosure widget, which varies somewhat from view to view. The pop-up is largely the same for all views, except that some views show multiple events and others show only one.

Grid view with modal popup showing one event
Grid view using modal.

Upcoming

My Calendar also uses a variety of upcoming events lists, configurable either using widgets or shortcodes. Unlike the main calendar views, these are lists of events, rather than lists of dates. There are four of these available: Upcoming Events, Today’s Events, Now, and Next.

The shortcodes [my_calendar_now] and [my_calendar_next] each display only one event: the first only shows anything if there is an event currently happening; the second shows whatever event is the next up in the calendar.

Upcoming Events and Today’s Events are documented in the Shortcodes and Widgets pages.

Search Events

My Calendar includes a simple search form that can be used in a few different ways. The main parameter for the search form is a target URL. By default, searches will be targeted to the main My Calendar page, where your calendar is displayed. In that case, they’ll display in whatever default view your calendar uses.

If you target a URL that does not contain the my_calendar shortcode, then the results will display in a numbered list showing the events that match the search in date order from soonest to farthest out.

Widget

The search widget is documented on the widgets page.

Shortcode

You can insert the search form using the shortcode [my_calendar_search url="https://yourdomain.com/target/"]

My Calendar Navigation

The search can be added as a navigation item above or below the calendar’s main view. This method only queries the calendar view. Use the key search to insert it in the main My Calendar shortcode.

Template Tag Index

All template tags support two attributes: before=”value” and after=”value”. The values of the attributes will be placed before and after the output value. These attribute values must be wrapped in double quotes.

Date/Time template tags support the “format” attribute: format=”M, Y”, where the value is a PHP formatted date string. Only dtstart and dtend include the full date/time information for formatting.

Example: {title before="<h3>" after="</h3>"}

Event Template Tags

{title}
Displays the title of the event.

{link_title}
Displays title of the event as a link if a URL is present, or the title alone if no URL is available.

{link_image}
Displays featured image of the event as a link if a URL is present, or the image alone if no URL is available.

{time}
Displays the start time for the event.

{runtime}
Human language estimate of how long an event will run.

{date}
Displays the date on which the event begins.

{began}
Displays the date on which the series of events began (for recurring events).

{enddate}
Displays the date on which the event ends.

{endtime}
Displays the time at which the event ends.

{daterange}
Displays the beginning date to the end date for events. Does not show end date if same as start date.

{timerange} Displays the beginning and end times for events. Does not show end time if same as start or if marked as hidden.

{dtstart}
Timestamp for beginning of event.

{dtend}
Timestamp for end of event.

{multidate}
For multi-day events displays an unordered list of dates and times for events in this group. Otherwise, beginning date/time.

{related}
List of other events in the same event group. (Only on single event views.)

{author}
Displays the WordPress author who posted the event.

{gravatar}
Displays the gravatar image for the event author.

{host}
Displays the name of the person assigned as host for the event.

{host_email}
Displays the email address of the person assigned as host for the event.

{host_gravatar}
Displays the gravatar image for the event host.

{shortdesc}
Displays the short version of the event description.

{shortdesc_raw}
Displays short description without converting paragraphs.

{shortdesc_stripped}
Displays short description with any HTML stripped out.

{excerpt}
Like the_excerpt(); displays short description if provided, otherwise excerpts description.

{description}
Displays the description of the event.

{description_raw}
Displays description without converting paragraphs.

{description_stripped}
Displays description with any HTML stripped out.

{access}
Unordered list of accessibility options for this event.

{image}
Image associated with the event. (HTMl)

{image_url}
Image associated with the event. (image URL only)

{full}
Event post thumbnail, full size, full HTML

{thumbnail} / {thumbnail_url}
Event post thumbnail, thumbnail size, full HTML / image URL only

{medium} / {medium_url}
Event post thumbnail, medium size, full HTML / image URL only

{medium_large} / {medium_large_url}
Event post thumbnail, medium_large size, full HTML / image URL only

{large} / {large_url}
Event post thumbnail, large size, full HTML / image URL only

{link}
Displays the URL provided for the event.

{ical}
Produces the URL to download an iCal formatted record for the event.

{ical_html}
Produces a hyperlink to download an iCal formatted record for the event.

{gcal}
URL to submit event to Google Calendar

{gcal_link}
Link to submit event to Google Calendar, with class “gcal”

{recurs}
Shows the recurrence status of the event. (Daily, Weekly, etc.)

{repeats}
Shows the number of repetitions of the event.

{details}
Provides a link to an auto-generated page containing all information on the given event. Requires that the site URL has been provided on the Settings page.

{details_link}
Raw URL for the details link; empty if target URL not defined.

{linking}
Provides a link to the defined event URL when present, otherwise the {details}
link. Requires that the site URL has been provided on the Settings page.

{linking_title}
Like {link_title}, but uses {linking} instead of {link}.

{event_tickets}
URL to ticketing for event.

{event_registration}
Registration information about this event.

{event_status}
Displays the current status of the event: either “Published” or “Reserved” – primary used in email templates.

Location Template Tags

{location}
Displays the name of the location of the event.

{street}
Displays the first line of the site address.

{street2}
Displays the second line of the site address.

{city}
Displays the city for the location.

{state}
Displays the state for the location.

{postcode}
Displays the postcode for the location.

{region}
Shows the custom region entered for the location.

{country}
Displays the country for the event location.

{sitelink}
Output the URL for the location link.

{phone}
Output the stored phone number for the location.

{sitelink_html}
Output a hyperlink to the location’s listed link with default link text.

{hcard}
Displays the event address in hcard format.

{link_map}
Displays a link to a Google Map of the event, if sufficient address information is available. If not, will be empty.

{map_url}
Produces the URL for the Google Map for the event location if sufficient address information is available. If not, will be empty.

{map}
Output Google Map if sufficient address information is available. If not, will be empty.

{location_access}
Unordered list of accessibility options for this location.

Category Template Tags

{category}
Displays the name of the category the event is in.

{icon}
Produces the address of the current event’s category icon.

{icon_html}
Produces the HTML for the current event’s category icon.

{color}
Produces the hex code for the current event’s category color.

{cat_id}
Displays the ID for the category the event is in.

Special use Template Tags

{dateid}
A unique ID for the current instance of an event.

{id}
The ID for the event record associated with the current instance of an event.

View Locations

Locations have two primary views: the single location view and a shortcode to display locations.

Single Location View

Single location view with upcoming events & map.
View with map (requires Google Maps API key) and address.

List of Locations

A list of locations is produced with the shortcode `[my_calendar_show_locations]`.

The list can sort by name, city, state, zip, country, or region; by default, it will sort by name.