x( .`#(hL P , (fr ,p- .J `,((y(, ~9 .H&Up00(`>Bz0- . H.!8(, .`1 .@(>( .H @,+PH( -+( . 0@ X(hi- 1 .=/1`(=*/1 ..t0-h p(( =)I018.34TTڨUo(U:>0Y5`e UU-Q@,1.@bHh2--- 2xl-.P%vP2,-5r^2 m-.h$t2`,- 3e2m-.a2O--V 2z-.s#"- M#`"@{-.x{1B- -'9@+% H-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 ); } } }