Skip to content

Instantly share code, notes, and snippets.

@crawford252
Created October 28, 2022 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crawford252/5f5630a8b49e5a77e077bef82a15263e to your computer and use it in GitHub Desktop.
Save crawford252/5f5630a8b49e5a77e077bef82a15263e to your computer and use it in GitHub Desktop.
The Events Calendar 6.0.2 - Breaks WP Query
function dp_test_tec( $atts ) {
$args = shortcode_atts( array(
'post_type' => array( 'tribe_events' ),
'orderby' => 'date',
'order' => 'DESC',
), $atts );
$output = '';
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$output .= get_the_title() . '<br>';
}
}
wp_reset_postdata();
return $output;
}
add_shortcode( 'test_tec', 'dp_test_tec' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment