Last active
September 24, 2021 20:52
-
-
Save lelandf/4ce96bbcff40d54681e7d41c5f5ed3c6 to your computer and use it in GitHub Desktop.
[TEC] for troubleshooting tribe_get_events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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