Tribe__Tickets__Tickets_Handler::flag_manual_update( int $meta_id, int $object_id, string $meta_key, $date )
On updating a few meta keys we flag that it was manually updated so we can do fancy matching for the updating of the event start and end date
Contents
Parameters
- $meta_id
-
(int) (Required) MID
- $object_id
-
(int) (Required) Which Post we are dealing with
- $meta_key
-
(string) (Required) Which meta key we are fetching
- $event_capacity
-
(int) (Required) To which value the event Capacity was update to
Return
(int)
Source
File: src/Tribe/Tickets_Handler.php
public function flag_manual_update( $meta_id, $object_id, $meta_key, $date ) {
$keys = array(
$this->key_start_date,
$this->key_end_date,
);
// Bail on not Date meta updates
if ( ! in_array( $meta_key, $keys ) ) {
return;
}
$updated = get_post_meta( $object_id, $this->key_manual_updated );
// Bail if it was ever manually updated
if ( in_array( $meta_key, $updated ) ) {
return;
}
// the updated metakey to the list
add_post_meta( $object_id, $this->key_manual_updated, $meta_key );
return;
}
Changelog
| Version | Description |
|---|---|
| 4.6 | Introduced. |