Tribe__Events__Main::addEventMeta( int $postId, WP_Post $post )
Adds / removes the event details as meta tags to the post.
Contents
Parameters
- $postId
-
(int) (Required)
- $post
-
(WP_Post) (Required)
Source
File: src/Tribe/Main.php
public function addEventMeta( $postId, $post ) {
static $avoid_recursion = false;
// Avoid an infinite loop, because saveEventMeta calls wp_update_post when the post is set to always show in calendar
if ( $avoid_recursion ) {
return;
}
$avoid_recursion = true;
$original_post = wp_is_post_revision( $post );
$is_event_revision = $original_post && tribe_is_event( $original_post );
if ( $is_event_revision ) {
$revision = Tribe__Events__Revisions__Post::new_from_post( $post );
$revision->save();
$avoid_recursion = false;
return;
}
$event_meta = new Tribe__Events__Meta__Save( $postId, $post );
$event_meta->maybe_save();
// Allow this callback to run
$avoid_recursion = false;
}