Skip to content

Instantly share code, notes, and snippets.

@lelandf
Last active September 24, 2021 20:52
Show Gist options
  • Save lelandf/4ce96bbcff40d54681e7d41c5f5ed3c6 to your computer and use it in GitHub Desktop.
Save lelandf/4ce96bbcff40d54681e7d41c5f5ed3c6 to your computer and use it in GitHub Desktop.
[TEC] for troubleshooting tribe_get_events
<?php
add_action( 'wp_footer', function() {
$args = [
'start_date' => 'now',
'posts_per_page' => 10,
'post_status' => 'publish',
];
$events = tribe_get_events( $args );
foreach ( $events as $key => $event ) {
echo 'This is event #' . ( $key + 1 ) . '<br>';
echo 'The WP post title: ' . $event->post_title . '<br>';
echo 'The WP publish date is: ' . $event->post_date . '<br>';
echo 'The TEC event date is: ' . $event->event_date . '<br>';
/* Uncomment if you want an entire dump of $event */
//echo '<pre>';
//var_dump( $event );
//echo '</pre>';
echo '---<br>';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment