1lU`[0lU[lU`[+plU\YlU\>@clU0_=`lUP_A lU_<lUP_@clU8`=`lUpP`A lU`<lU``@clU @a=`lUPaA lUa<lUpa@clUHb=`lUPbA lU b<lU b@clUphe=`lU`PeA`lUP`eA lUPe<lUP`eG@clUpe=`lUPeA`lU`eA lUpe<lUp`eHlU`reG@clUxf=`lUpPfA`lU``fA lUf<lUfG@clUf=`lUPfA`lU`fA lUf<lUfH0lUfH@clUg=`lUPgA lUg<lUgG@clU0g=`lU PgA lUg<lUgH0lUgH@clUh=`lUPhA lUh<lUhGlU`eH0lUPeH@clU@i=`lU0PiA lUi<lU iG@clUi=`lUPiA lU0i<lU0 iH0lU iH@lUp@eG@clU`j=`lUPPjA lUPj<lUP@jH0lU@jH@lU`eG@clUk=`lUPkA lUpk<lUp`kH0lU`kHlUPlGlUPlH0lU0lHlU`mGlU`mH0lUmH@lUeGlUpnH0lUnHlUoGlUoH0lUPoH@clU@p=`lU0PpA lUp<lUpG@clUp=`lUPpA lUp<lUpH0lUpH@clUpq=`lU`PqA lUq<lUqG@clUq=`lUPqA lUq<lUqH0lUqH@clUr=`lUPrA lU r<lU 0rG@clU@r=`lU0PrA lU@r<lU@0rH0lU0rH@clUs=`lUPsA lUPs<lUP`sG@clUps=`lU`PsA lUps<lUp`sH0lU`sH@clUt=return; } /** * Fires before the Metabox saved the data from the current request. * * @since 5.11.0 * * @param int $post_id The post ID of the event currently being saved. * @param array The whole data received by the metabox. */ do_action( 'tribe_events_event_status_before_metabox_save', $post_id, $data ); $status = Arr::get( $data, 'status' ); if ( 'scheduled' !== $status ) { $this->update_fields( $post_id, $data ); } else { $this->delete_fields( $post_id, $data ); } /** * Fires after the Metabox saved the data from the current request. * * @since 5.11.0 * * @param int $post_id The post ID of the event currently being saved. * @param array The whole data received by the metabox. */ do_action( 'tribe_events_event_status_after_metabox_save', $post_id, $data ); } /** * Update event status meta fields. * * @since 5.11.0 * * @param int $post_id Which post ID we are dealing with when saving. * @param array $data An array of meta field values. */ public function update_fields( $post_id, $data ) { update_post_meta( $post_id, Event_Meta::$key_status, Arr::get( $data, 'status', false ) ); update_post_meta( $post_id, Event_Meta::$key_status_reason, Arr::get( $data, 'status-reason', false ) ); /** * Allows extensions and compatibilities to save their associated meta. * * @since 5.11.0 * * @param int $post_id ID of the post we're saving. * @param array $data The meta data we're trying to save. */ do_action( 'tribe_events_event_status_update_post_meta', $post_id, $data ); } /** * Delete event status meta fields. * * @since 5.11.0 * * @param int $post_id Which post ID we are dealing with when saving. * @param array $data An array of meta field values. */ public function delete_fields( $post_id, $data ) { foreach ( Event_Meta::$event_status_keys as $key ) { delete_post_meta( $post_id, $key ); } } }