Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Welcome to you dashboard <?php global $current_user; get_currentuserinfo(); echo ($current_user->user_login); ?>.
- <?php
- global $current_user;
- get_currentuserinfo();
- $user = $current_user->ID;
- $query = new WP_Query( array(
- 'author' => $user, // Show Posts made only by the current user.
- 'post_type' => 'tutorial',
- 'posts_per_page' => '5',
- 'post_status' => array(
- 'publish',
- 'pending',
- 'draft',
- 'private',
- 'trash'
- )
- ) );
- ?>
- <table>
- <tr>
- <th>Post Title</th>
- <th>Post Status</th>
- <th>Actions</th>
- </tr>
- <?php
- if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
- <tr>
- <td><?php echo get_the_title(); ?></td>
- <td><?php echo get_post_status( get_the_ID() ) ?></td>
- <td>
- <?php the_post_thumbnail(thumbnail); ?>
- </a>
- </td>
- </tr>
- <?php endwhile; endif; ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement