یه مثال میزنم شاید کاربردی باشه:
if ( isset( $_GET['do'] ) and $_GET['do'] == 'export-post' ) {
$args = array(
'posts_per_page' => - 1,
'post_type' => 'post',
'post_status' => 'publish',
);
echo '<table border="1" width="50%" style="margin: 0 auto" cellpadding="5" cellspacing="0">';
echo '<tr>';
echo '<td>ID</td>';
echo '<td>Name</td>';
echo '<td>Date</td>';
echo '</tr>';
foreach ( get_posts( $args ) as $post ) {
echo '<tr>';
echo '<td>'.$post->ID.'</td>';
echo '<td>'.$po