Series_Metaboxes::relationship()
Render the series metabox into the admin of the events.
Source
File: src/Events_Pro/Custom_Tables/V1/Editors/Classic/Series_Metaboxes.php
public function relationship(): void {
$field_name = Relationship::SERIES_TO_EVENTS_REQUEST_KEY;
$events = $this->get_events();
$relationships = [];
$series_post_id = get_the_ID();
if ( $series_post_id ) {
$relationships = wp_list_pluck(
Series_Relationship::where( 'series_post_id', $series_post_id )->get(),
'event_post_id'
);
}
$events = array_map(
static function ( $event ) use ( $relationships ) {
return [
tribe_get_event( $event ),
in_array( $event->ID, $relationships, true ),
];
},
$events
);
include __DIR__ . '/partials/series-event-relationship.php';
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |