0 ) { $event = ThreeCal_Event::get( $event_id ); if ( ! $event ) { wp_die( esc_html__( 'Event not found.', '3task-calendar' ) ); } } // A date from a post is edited in the post, there is only one source. $threecal_from_post = ThreeCal_Post_Dates::post_of( $event ); if ( $threecal_from_post && get_post( $threecal_from_post ) ) { echo '

'; /* translators: %s: title of the post */ echo esc_html( sprintf( __( 'This date comes from the post "%s" and is edited there. Changes made here would be overwritten.', '3task-calendar' ), get_the_title( $threecal_from_post ) ) ); $threecal_edit_link = get_edit_post_link( $threecal_from_post, 'raw' ); if ( $threecal_edit_link ) { echo ' ' . esc_html__( 'Edit the post', '3task-calendar' ) . ''; } echo '

'; return; } $is_new = empty($event); $page_title = $is_new ? __('Add New Event', '3task-calendar') : __('Edit Event', '3task-calendar'); // Get data for dropdowns $locations = ThreeCal_Location::get_all(); $event_categories = $event ? ThreeCal_Event::get_categories($event_id) : array(); $event_category_ids = array_map(function($c) { return $c->id; }, $event_categories); /** This filter is documented in admin/class-admin.php */ if ( $event && ! apply_filters( 'threecal_user_can_save_event', true, $event, $event_category_ids ) ) { wp_die( esc_html__( 'Permission denied.', '3task-calendar' ), '', array( 'back_link' => true ) ); } /** * Filters the categories offered in the event form. * * @param array $categories Hierarchical category list. * @param ThreeCal_Event|null $event The event being edited, null for a new one. */ $categories = apply_filters( 'threecal_admin_category_choices', ThreeCal_Category::get_hierarchical(), $event ); // Default values. $defaults = array( 'title' => '', 'description' => '', 'start_date' => gmdate( 'Y-m-d\TH:i' ), 'end_date' => '', 'all_day' => false, 'location_id' => 0, 'url' => '', 'featured_image' => 0, 'color' => '#3788d8', 'status' => 'draft' ); // Messages. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View file, message param is for display only. $message = isset( $_GET['message'] ) ? sanitize_text_field( wp_unslash( $_GET['message'] ) ) : ''; ?>

(). . .

description : $defaults['description'], 'event_description', array( 'textarea_name' => 'event_description', 'textarea_rows' => 10, 'media_buttons' => true ) ); ?>
is_month_only(); ?>
> >

>
>
parent_id ) : ?>

>

+

get_organizer() : array( 'name' => '', 'url' => '' ); ?>

+

featured_image) : ?> featured_image, 'medium'); ?>
parent_id && $event->recurrence_rule ) : $threecal_split = $event->get_split_events(); $threecal_dates = array_merge( $threecal_split, array( $event ), $event->get_series_events() ); $threecal_split_ids = array_map( 'intval', wp_list_pluck( $threecal_split, 'id' ) ); $threecal_dformat = threecal_date_format(); $threecal_tformat = threecal_time_format(); $threecal_today = current_time( 'Y-m-d' ); $threecal_live = 'published' === $event->status; $threecal_base = admin_url( 'admin.php?page=3task-calendar&tab=events&series=' . $event->id ); ?>

start_date, 0, 10 ); $threecal_ts = strtotime( $threecal_date->start_date ); $threecal_past = $threecal_day < $threecal_today; $threecal_first = (int) $threecal_date->id === (int) $event->id; $threecal_sep = in_array( (int) $threecal_date->id, $threecal_split_ids, true ); $threecal_off = 'cancelled' === $threecal_date->status; $threecal_url = function ( $action ) use ( $threecal_base, $threecal_day, $event ) { return wp_nonce_url( add_query_arg( array( 'threecal_date_action' => $action, 'date' => $threecal_day ), $threecal_base ), 'threecal_series_' . $event->id ); }; ?>
all_day ) : ?>