Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'admin_notices', 'tribe_temp_debug_test' );
- function tribe_temp_debug_test() {
- $query = new WP_Query( array(
- 'post_status' => 'any',
- 'posts_per_page' => 1,
- 'meta_key' => '_EventStartDate',
- 'category_name' => 'Events'
- ));
- echo '<p> </p><strong> Debug information </strong> ';
- if ( 0 === count( $query->posts ) ) echo 'Nothing found';
- else {
- $post = array_shift($query->posts);
- echo ' ID=' . $post->ID;
- echo ' | TYPE=' . $post->post_type;
- $categories = get_the_terms( $post->ID, 'category' );
- $terms = '';
- if ( is_array( $categories ) ) {
- foreach ( $categories as $cat ) $terms .= $cat->name . ' ';
- }
- echo ' | TERMS=' . $terms;
- $meta = get_post_meta( $post->ID );
- $fields = '';
- foreach ( $meta as $key => $value ) $fields .= $key . ':' . $value . ' ';
- $fields = empty( $fields ) ? 'None' : $fields;
- echo ' | FIELDS=' . $fields;
- }
- echo '</p>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement