=== Licinio Event Calendar ===
Contributors: umlouco
Tags: calendar, events, event calendar, timeline, booking
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 2.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Event calendar, event list, category view and timeline blocks, with optional Contact Form 7 booking and attendee limits.

== Description ==

Licinio Event Calendar adds an **Events** post type and four blocks for showing those events anywhere on your site. Each block includes a server-rendered editor preview using your real event data. Interactive calendar navigation is available on the published page.

= The four blocks =

* **Licinio Event Calendar** — an interactive month, week and list calendar powered by FullCalendar. Events load from the site's REST API as visitors move between months.
* **Licinio Event List** — upcoming events grouped by day, with date badges, time, location and an optional thumbnail.
* **Licinio Category View** — a category dropdown plus a calendar/list toggle, so visitors can narrow the events down themselves.
* **Licinio Timeline** — a horizontal, swipeable timeline of event cards showing places left and a "Book Now" button.

Block settings include event categories, post types and layout-specific display options. Shortcodes also support period and event-count attributes.

= Events =

Events live under **Events** in the admin menu. Each event has:

* a start and end date, set with a date picker,
* event categories,
* a poster image (falls back to the featured image),
* an optional Contact Form 7 booking form and a maximum number of attendees.

The **Event Date** box is also added to your other public post types, so posts, pages or custom post types can appear in the calendar too.

= Bookings with Contact Form 7 =

If [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) is active, choose a form in the **Event Booking** box on any event. The form is shown on the event page and every successful submission takes one place. When the event is full, the form is replaced by a "This event is fully booked" notice and the blocks mark the event as **Fully Booked**.

In form templates, use named tags such as `[licinio_event_title event-title]` and `[licinio_event_date event-date]`. In emails, use the special mail-tags `[licinio_event_title]` and `[licinio_event_date]`.

Contact Form 7 is optional. Without it, everything except booking works.

= Shortcodes =

The same layouts are available as shortcodes for the classic editor and page builders:

* `[licinio_calendar category="concerts" period="month"]`
* `[licinio_event_list category="concerts" period="month" limit="10" show_thumbnails="false"]`
* `[licinio_category_view period="month"]`
* `[licinio_timeline period="year" max_events="20"]`

= Settings =

**Settings → Licinio Event Calendar** includes the calendar timezone and defaults for event views and counts. Use each block's settings to configure its display. The colour-scheme and fallback-form fields are reserved for future use; assign booking forms directly to events.

= For developers =

* REST endpoints: `GET /wp-json/licinio-event-calendar/v1/events` and `GET /wp-json/licinio-event-calendar/v1/events/{id}`. Both are read-only and only return published events from public post types.
* Filters `licinio_calendar_start_meta_keys` and `licinio_calendar_end_meta_keys` let you read event dates from your own custom fields.

Full documentation: [mario-flores.com/plugins/licinio-event-calendar](https://mario-flores.com/plugins/licinio-event-calendar/)

= Privacy =

Licinio Event Calendar does not track visitors, set cookies, or contact any external service. All scripts and styles, including FullCalendar, are served from your own site. Booking submissions are processed by Contact Form 7 and its configured mail or storage integrations; Licinio Event Calendar only stores a count of places taken on each event.

= Third-party library =

The calendar views use [FullCalendar](https://fullcalendar.io/) 6.1.21 by Adam Shaw, released under the MIT license (included in `js/fullcalendar.LICENSE.txt`). `js/fullcalendar.min.js` is the unmodified standard bundle; its source code is at [github.com/fullcalendar/fullcalendar](https://github.com/fullcalendar/fullcalendar/tree/v6.1.21).

All other JavaScript in the plugin is shipped as readable source with no build step.

== Installation ==

1. In your admin, go to **Plugins → Add New**, search for "Licinio Event Calendar" and click **Install Now**, then **Activate**.
2. Add a few events under **Events → Add New** and set their dates in the **Event Date** box.
3. Edit a page, add one of the Licinio Event Calendar blocks and adjust it in the block settings panel.
4. Optionally review the defaults under **Settings → Licinio Event Calendar**.

== Frequently Asked Questions ==

= Do I need Contact Form 7? =

Only for bookings. The calendar, list, category view and timeline all work without it.

= Can I show normal posts or a custom post type in the calendar? =

Yes. Give them a date in the **Event Date** box, then enter the post type names (comma separated) in the block's **Post type** setting. Only public post types can be shown.

= My events are stored in other custom fields. Can the calendar read them? =

Yes. Add your field names with the `licinio_calendar_start_meta_keys` and `licinio_calendar_end_meta_keys` filters. Values can be Unix timestamps or any date string PHP understands.

= Which timezone does the calendar use? =

The timezone chosen under **Settings → Licinio Event Calendar**. New installs default to your site timezone.

= What happens to my events if I delete the plugin? =

They stay. Uninstalling removes only the plugin's settings. Your events and categories remain in the database and come back if you reinstall.

== Screenshots ==

1. The Licinio Event Calendar block in month view.
2. The Licinio Event List block, with events grouped by day.
3. The Licinio Category View block with its category filter and calendar/list toggle.
4. The Licinio Timeline block, showing places left and the fully-booked state.
5. Site-wide defaults under Settings → Licinio Event Calendar.

== Changelog ==

= 2.5.0 =
* First release on WordPress.org, under the name "Licinio Event Calendar" (slug: licinio-event-calendar).
* Fixed date-range overlap and expired-event filtering, timezone-aware calendar and list dates, and password-protected event visibility.
* Fixed category-list requests on sites using plain permalinks.
* Avoided showing an unresolved booking shortcode when Contact Form 7 is inactive.
* Updated all internal identifiers to a distinctive "licinio" prefix.
* Upgraded FullCalendar to 6.1.21.

= 2.4.0 =
* Prepared the plugin for WordPress.org review.
* The calendar views now use the timezone from Settings → Licinio Event Calendar instead of always using Europe/Rome. New installs default to the site timezone.
* The REST API and blocks only query public post types, and single-event responses skip password-protected and non-public posts.
* Fixed event end dates stored as date strings in REST responses, and event sorting when dates are stored as strings.
* Admin scripts moved from inline script tags into enqueued files.
* New `licinio_calendar_start_meta_keys` and `licinio_calendar_end_meta_keys` filters.
* Output escaping and input sanitising tightened, translation template added, and plugin settings are removed on uninstall.

= 2.3.0 =
* Editor previews now use real server-rendered block output.
* Added block wrapper attributes and full editor support controls.

= 2.2.0 =
* Server-rendered Gutenberg editor previews.

= 2.1.1 =
* Visual editor previews and inserter examples for all four blocks.

= 2.1.0 =
* Restored shortcode compatibility for all four layouts.
* Unified event-date parsing across blocks, shortcodes and REST.
* Added FullCalendar `start` / `end` range parameters to the REST endpoint.

= 2.0.0 =
* Replaced shortcodes with Gutenberg blocks: Calendar, Event List, Category View and Timeline.
* Added the REST API endpoint, settings page and Contact Form 7 booking.

= 1.0.0 =
* Initial release with a shortcode-based calendar.

== Upgrade Notice ==

= 2.4.0 =
The calendar now follows the timezone in Settings → Licinio Event Calendar. Existing sites keep their saved setting.
