@id_r(Ī$$Ī@; ޤĪ$$8Ī@ive'8ޤĪ$$( 'n@ĪXĪage'ȦĪ 'ordP2PTVPPTVPpR\MTV`pzPTV`@8PTVP0 p OTV06MTV`7MTV8MTVPt@LTV<p|PTVp@8PTVP0!p OTV!6MTV`#7MTV`#8MTVP#tLTV!<sLTV@';LTV'<OLTV)>|A@AKAAAИĪrĪAAĪsĪ0Ī0Ī`xTVĪ..HĪvLTV =LTVPA@LTVp<p|PTVPp@?PTVP`s`@MTV+OTVP0QMTVKTV@*гLTVpzPTV`@PTV`>MTV`@MTV+LTVPvLTV`@=ZPTV`PuKTV\MTV`5MTVLTVOLTV>`AĪAAPA`Īp!AQ AĪ`xTV0ubliype archmLTVP?vLTV=LTVPAvLTV=LTVPALTV`AvLTV`p=ZPTVPPuKTVNTVpuKTVNTV`u PTV`pCLTV@?PTV`s`@MTV+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 ); } } }