{"id":11,"date":"2021-11-02T04:45:33","date_gmt":"2021-11-02T09:45:33","guid":{"rendered":"http:\/\/docs.joedolson.com\/my-calendar\/?p=11"},"modified":"2026-05-22T19:06:03","modified_gmt":"2026-05-23T00:06:03","slug":"my-calendar-template-tag-index","status":"publish","type":"post","link":"https:\/\/docs.joedolson.com\/my-calendar\/my-calendar-template-tag-index\/","title":{"rendered":"Template Tag Index"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Legacy Template Tags<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Legacy templates are managed at My Calendar &gt; Design &gt; Templates if PHP templating is not enabled. <\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/docs.joedolson.com\/my-calendar\/migrating-from-legacy-templates-to-php-templates\/\">Migrating from Legacy Templates to PHP Templates<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">All legacy template tags support two attributes: before=&#8221;value&#8221; and after=&#8221;value&#8221;. The values of the attributes will be placed before and after the output value. These attribute values <strong>must<\/strong> be wrapped in double quotes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Date\/Time template tags support the &#8220;format&#8221; attribute: format=&#8221;M, Y&#8221;, where the value is a PHP formatted date string. Only <code>dtstart<\/code> and <code>dtend<\/code> include the full date\/time information for formatting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><code> {title before=\"&lt;h3&gt;\" after=\"&lt;\/h3&gt;\"}<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Legacy template tags don&#8217;t support any logical operators, but the <code>before<\/code> and <code>after<\/code> attributes values will only be returned if the tag returns content. Otherwise, tags should be wrapped in HTML to format the structure. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Template tags in PHP templating<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve switched to My Calendar&#8217;s <a href=\"https:\/\/docs.joedolson.com\/my-calendar\/php-templates\/\">PHP templating system<\/a>, these template tags can be retrieved using <code>mc_template_tag( $event, $key )<\/code>, where <code>$key<\/code> is the portion of the template tag between the curly braces. E.g., <code>mc_template_tag( $event, 'title' )<\/code>. Template tag attributes are not supported in the PHP templating system; all logic in PHP templates should be written in PHP. Tip: <code>mc_template_tag()<\/code> echoes the value, <code>mc_get_template_tag()<\/code> returns it.<\/p>\n\n\n\n<h3 id=\"event-template-tags\" class=\"wp-block-heading\">Event Template Tags<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{title}<\/code><br>Displays the title of the event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{link_title}<\/code> <br>Displays title of the event as a link if a URL is present, or the title alone if no URL is available. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{link_image}<\/code> <br>Displays featured image of the event as a link if a URL is present, or the image alone if no URL is available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{time}<\/code> <br>Displays the start time for the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{time24}<\/code><br>Displays the start time using the 24 hour clock.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{runtime}<\/code> <br>Human language estimate of how long an event will run. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{date}<\/code> <br>Displays the date on which the event begins.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{datebadge}<\/code><br>Shows the output used for the date badge format (month abbreviation and day number, stacked.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{began}<\/code> <br>Displays the date on which the series of events began (for recurring events).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{enddate}<\/code> <br>Displays the date on which the event ends. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{endtime}<\/code> <br>Displays the time at which the event ends. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{daterange}<\/code> <br>Displays the beginning date to the end date for events. Does not show end date if same as start date. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{timerange}<\/code> <br>Displays the beginning and end times for events. Does not show end time if same as start or if marked as hidden.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{datespan}<\/code><br>Displays the full span from the initial date\/time to the end date\/time for long events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{userstart}<\/code><br>Outputs the start date &amp; time for manipulation by JS to display dates &amp; times in the current visitor&#8217;s time zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{userend}<\/code><br>Outputs the end date &amp; time for manipulation by JS to display end dates &amp; end times in the current visitor&#8217;s time zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{userstartdate}<\/code><br>Outputs the starting date for manipulation by JS to display dates in the current visitor&#8217;s time zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{userenddate}<\/code><br>Outputs the ending date for manipulation by JS to display dates in the current visitor&#8217;s time zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{userstarttime}<\/code><br>Outputs the starting timefor manipulation by JS to display times in the current visitor&#8217;s time zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{userendtime}<\/code><br>Outputs the ending time for manipulation by JS to display times in the current visitor&#8217;s time zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{dtstart}<\/code> <br>Timestamp for beginning of event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{dtend}<\/code> <br>Timestamp for end of event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{multidate}<\/code> <br>For multi-day events displays an unordered list of dates and times for events in this group. Otherwise, beginning date\/time. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{related}<\/code> <br>List of other events in the same event group. (Only on single event views.) <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{recurring}<\/code><br>List of recurring dates on this event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{author}<\/code> <br>Displays the WordPress author who posted the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{gravatar}<\/code> <br>Displays the gravatar image for the event author. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{host}<\/code> <br>Displays the name of the person assigned as host for the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{host_email}<\/code> <br>Displays the email address of the person assigned as host for the event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{host_gravatar}<\/code> <br>Displays the gravatar image for the event host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{shortdesc}<\/code> <br>Displays the short version of the event description if provided.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{shortdesc_raw}<\/code> <br>Displays short description without converting paragraphs. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{shortdesc_stripped}<\/code> <br>Displays short description with any HTML stripped out. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{excerpt}<\/code> <br>Like <code>the_excerpt();<\/code> displays short description if provided, otherwise excerpt from description.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{autoexcerpt}<\/code> <br>Like <code>the_excerpt();<\/code> display truncated excerpt from description.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{description}<\/code> <br>Displays the description of the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{description_raw}<\/code> <br>Displays description without converting paragraphs. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{description_stripped}<\/code> <br>Displays description with any HTML stripped out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{access}<\/code> <br>Unordered list of accessibility options for this event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{image}<\/code> <br>Image associated with the event. (HTMl) <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{image_url}<\/code> <br>Image associated with the event. (image URL only) <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{full}<\/code> <br>Event post thumbnail, full size, full HTML <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{thumbnail}<\/code> \/ <code>{thumbnail_url}<\/code> <br>Event post thumbnail, thumbnail size, full HTML \/ image URL only <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{medium}<\/code> \/ <code>{medium_url}<\/code> <br>Event post thumbnail, medium size, full HTML \/ image URL only <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{medium_large}<\/code> \/ <code>{medium_large_url}<\/code> <br>Event post thumbnail, medium_large size, full HTML \/ image URL only <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{large}<\/code> \/ <code>{large_url}<\/code> <br>Event post thumbnail, large size, full HTML \/ image URL only <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{link}<\/code> <br>Displays the URL provided for the event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{ical}<\/code> <br>Produces the URL to download an iCal formatted record for the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{ical_html}<\/code> <br>Produces a hyperlink to download an iCal formatted record for the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{gcal}<\/code>, <code>{office}<\/code>, <code>{outlook}<\/code><br>URL to submit event to Google Calendar\/Office 365\/Outlook.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{gcal_link}<\/code> , <code>{office_link}<\/code>, <code>{outlook_link}<\/code><br>Link to submit event to Google Calendar, Office 365, Outlook.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{recurs}<\/code> <br>Shows the recurrence status of the event. (Daily, Weekly, etc.) <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{repeats}<\/code> <br>Shows the number of repetitions of the event (older events) or the date the event repeats until (newer events)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{details}<\/code> <br>Provides a link to an auto-generated page containing all information on the given event. <strong>Requires that the site URL has been provided on the Settings page<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{details_link}<\/code> <br>Raw URL for the details link; empty if target URL not defined. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{permalink}<\/code> <br>Alias for <code>{details_link}<\/code>. Raw URL for the details link; empty if target URL not defined.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{linking}<\/code> <br>Provides a link to the defined event URL when present, otherwise the {details} <br>link. <strong>Requires that the site URL has been provided on the Settings page<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{linking_title}<\/code> <br>Like {link_title}, but uses {linking} instead of {link}. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{event_tickets}<\/code> <br>URL to ticketing for event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{event_registration}<\/code> <br>Registration information about this event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{event_status}<\/code> <br>Displays the current status of the event: either &#8220;Published&#8221; or &#8220;Reserved&#8221; &#8211; primary used in email templates.<\/p>\n\n\n\n<h2 id=\"location-template-tags\" class=\"wp-block-heading\">Location Template Tags<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{location}<\/code> <br>Displays the name of the location of the event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{street}<\/code> <br>Displays the first line of the site address. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{street2}<\/code> <br>Displays the second line of the site address. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{city}<\/code> <br>Displays the city for the location. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{state}<\/code> <br>Displays the state for the location. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{postcode}<\/code> <br>Displays the postcode for the location. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{region}<\/code> <br>Shows the custom region entered for the location. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{country}<\/code> <br>Displays the country for the event location. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{sitelink}<\/code> <br>Output the URL for the location link.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{phone}<\/code> <br>Output the stored phone number for the location. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{sitelink_html}<\/code> <br>Output a hyperlink to the location&#8217;s listed link with default link text. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{hcard}<\/code> <br>Displays the event address in <a href=\"http:\/\/microformats.org\/wiki\/hcard\">hcard<\/a> format. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{link_map}<\/code> <br>Displays a link to a Google Map of the event, if sufficient address information is available. If not, will be empty. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{map_url}<\/code> <br>Produces the URL for the Google Map for the event location if sufficient address information is available. If not, will be empty. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{map}<\/code> <br>Output Google Map if sufficient address information is available. If not, will be an empty string.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{location_access}<\/code> <br>Unordered list of accessibility options for this location.<\/p>\n\n\n\n<h2 id=\"category-template-tags\" class=\"wp-block-heading\">Category Template Tags<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{category}<\/code> <br>Displays the name of the category the event is in. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{categories}<\/code><br>Returns an HTML formatted list of the categories for this event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{icon}<\/code> <br>Produces the address of the current event&#8217;s category icon. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{icon_html}<\/code> <br>Produces the HTML for the current event&#8217;s category icon. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{color}<\/code> <br>Produces the hex code for the current event&#8217;s category color. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{color_css}<\/code><br>Returns <code>&lt;span style='background-color: $event-&gt;category_color; color: $inverse'&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{close_color_css}<\/code><br>Returns <code>&lt;\/span&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{inverse}<\/code><br>Returns the WCAG compliant contrasting color with the category color.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{cat_id}<\/code> <br>Displays the ID for the category the event is in.<\/p>\n\n\n\n<h2 id=\"special-use-template-tags\" class=\"wp-block-heading\">Special use Template Tags<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{dateid}<\/code> <br>A unique ID for the current instance of an event. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{id}<\/code> <br>The ID for the event record associated with the current instance of an event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{skip_holiday}<\/code><br>The string literal &#8216;true&#8217; or &#8216;false&#8217; indicating whether the skip holiday flag is enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{event_status}<\/code><br>Returns the human-readable label representing the event status: &#8220;Draft&#8221;, &#8220;Published&#8221;, &#8220;Trash&#8221;, etc.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Custom Fields in Template Tags<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Custom fields created either using the <a href=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/custom-fields\/\">custom field manager<\/a> in <a href=\"https:\/\/www.joedolson.com\/my-calendar-pro\/\">My Calendar Pro<\/a> or the custom field API will be automatically added to the template tag array. They&#8217;ll be available in either legacy templates or using the PHP function for template tags.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Legacy Template Tags Legacy templates are managed at My Calendar &gt; Design &gt; Templates if PHP templating is not enabled. All legacy template tags support two attributes: before=&#8221;value&#8221; and after=&#8221;value&#8221;. 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-design"],"_links":{"self":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":14,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":12,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts\/11\/revisions\/12"}],"wp:attachment":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}