✨ 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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user