Repository navigation
Meta Field — The Event's Details Columns
A new meta field outputs the event's details, venue and organizer as columns, like the meta section of The Events Calendar's default single event template, with two differences: the map is left out, and the venue, which TEC sets apart beside the map, is a column alongside the others.
metafield —{"field":"meta"}outputs a.method-tec-metacontainer with one.method-tec-meta__groupcolumn per group that has data, in the order--details,--venue,--organizer. Each column is anh3.method-tec-meta__titleand aul.method-tec-meta__listofli.method-tec-meta__itementries, with.method-tec-meta__labeland.method-tec-meta__valuespans wherever TEC shows a label. Every item carries a modifier class naming it.- Details — the rows TEC shows for all-day, multi-day and single-day events (
--start-dateand--end-date,--date,--start-datetimeand--end-datetime, or--dateand--time), with the time zone in a.method-tec-meta__timezonespan when TEC's Show time zone setting is on; then cost (--cost), categories (--categories), tags (--tags) and the event website (--website). Dates are<time datetime="…">elements rather than TEC's<abbr title="…">. - Venue — only when the event has a venue: the name (
--venue-name), the address with TEC's map link inside an<address>(--address), phone (--phone) and website (--website). Address, phone and website are left out when the venue is password protected, as in TEC's template. - Organizer — only when the event has an organizer: each organizer's linked name (
--organizer-name), then phone (--phone), email (--email) and website (--website) when there is a single organizer that isn't password protected. The heading is TEC's singular or plural organizer label. - TEC's strings — headings and labels use TEC's own strings and text domain, so translations and the venue and organizer label settings apply, and the
tribe_events_single_event_time_titleandtribe_events_single_event_time_formattedfilters are honoured. - TEC's actions fire —
tribe_events_single_meta_beforeand_afteraround the output,tribe_events_single_event_meta_primary_section_startand_endinside the container, and the details, venue and organizer_section_startand_section_endactions (withtribe_events_single_meta_details_section_after_datetime) inside the lists. Each is captured and placed where TEC's template places it. With Events Calendar Pro active that brings in the organizer phone and email visibility settings, the series link, the virtual event link, the venue name linked to its page, and the "Other" additional fields group, which becomes a further column. - No map — the map is never part of the field; the
mapfield remains the way to output it. - Column styles — a small stylesheet is added inline, under the
method-tec-data-helper-metahandle, the first time the field renders: the container is a wrapping flex row with a--method-tec-meta-gapgap (2remby default); on desktop every column is the same width, however many there are; on tablet at most two columns share a row; on mobile there is one column. Lists lose their bullets, labels are bold on their own line, and the address loses its italics. Anything else is left to the theme. - Breakpoints — Method's block breakpoints when the theme is active (with the default dimensions: mobile below 768px, tablet from 768px to 1199px, desktop from 1200px), and those same values otherwise.
method_tec_data_helper_meta_stylesfilter — the CSS string, with the breakpoints as the second argument. Return an empty string to leave styling to the theme entirely.- New
method_render_event_meta( $event_id )— the function behind the field, usable on its own. Call it while the template is rendering so the styles are enqueued in time. - Not an event — nothing is output, without the wrapper.
Add to Calendar Field — TEC's Dropdown
A new add-to-calendar field outputs The Events Calendar's "Add to calendar" dropdown for the event, as TEC's default single event template shows it under the content.
add-to-calendarfield —{"field":"add-to-calendar"}outputs TEC's dropdown: a.tribe-events-c-subscribe-dropdownbutton that opens a list of Google Calendar, iCalendar, Outlook 365 and Outlook Live links, each built by TEC's own link classes. TEC's visibility filters (tec_views_v2_subscribe_link_visibilityand the per-linktec_views_v2_subscribe_link_{slug}_visibility) and theme overrides of itsv2/components/subscribe-linkstemplates apply. With one link visible TEC shows a single button instead, and with subscribe links turned off throughtec_views_v2_use_subscribe_linksit shows its classic Google Calendar and iCalendar buttons.- Single event pages only — TEC builds these links from the global post and only on a single event page, so the field outputs nothing elsewhere, such as in a Query Loop on the events archive. On an event page it follows the block's post: another event's links can be output, say in a related events loop, because that event is swapped in while rendering.
- Password protected — nothing is output for a password-protected event, as in TEC's template.
- Assets — TEC's
tribe-events-views-v2-skeletonstyles, itstribe-events-views-v2-fullstyles unless TEC's stylesheet setting is Skeleton, and itstribe-events-views-v2-ical-linksscript are enqueued once per request. TEC prints these styles the moment they are enqueued, and in a block theme the template renders beforewp_head, so the enqueue waits forwp_enqueue_scriptsto keep them in<head>; rendered later than that, they are printed in place. TEC loads them on single event pages anyway; this covers themes that keep TEC's view assets off. - No empty wrapper — when there is nothing to show the block returns an empty string, without the wrapper element.
- New
method_render_event_calendar_links( $event_id )— the function behind the field, usable on its own. Call it while the template is rendering so the assets are enqueued in time.
Fixed — venue Field After the meta Field
Events Calendar Pro hooks tribe_events_single_meta_before to link the next venue name to the venue's page, and removes itself once used. On an event without a venue the meta field fires the action but never asks for a venue name, so the link filter would still be waiting when a later venue field asked for one, and that field would output an escaped, empty link.
- Now skipped without a venue — the
venuefield outputs nothing (inside its wrapper, as before) when the event has no venue, so the waiting filter is never triggered by it.
Housekeeping
- Version bumped to 1.0.3.