Created
October 28, 2022 16:41
-
-
Save crawford252/5f5630a8b49e5a77e077bef82a15263e to your computer and use it in GitHub Desktop.
The Events Calendar 6.0.2 - Breaks WP Query
This file contains 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
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