feature: Add calendar layout and occurrence handling functionality

- Introduced `calendar-layout.php` to manage month grid generation, occurrence intersection checks, and segment assignments for events.
- Added `occurrences.php` for normalizing, validating, and displaying event occurrences, including migration from legacy formats.
- Implemented functions for parsing dates, validating occurrence ranges, and formatting occurrences for display.
- Established hooks for synchronizing event occurrence data upon saving posts and validating ACF repeater fields.
This commit is contained in:
Keith Solomon
2026-07-06 10:26:36 -05:00
parent 6ba917bf9b
commit 42ff7754cb
16 changed files with 2205 additions and 344 deletions
+17
View File
@@ -9,6 +9,23 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Build safe contact-email markup for event templates.
*
* @param mixed $value Raw contact email value.
* @return string Escaped mailto anchor, or an empty string for invalid input.
*/
function aa_events_contact_email_markup( $value ) {
$raw = trim( (string) $value );
$email = sanitize_email( $raw );
if ( '' === $email || $email !== $raw ) {
return '';
}
$protected = antispambot( $email );
return '<a href="' . esc_attr( 'mailto:' . $protected ) . '">' . wp_kses_post( $protected ) . '</a>';
}
/**
* Load a template.
*