我正在使用custom post_type 和inside the loop 我回显get\\u delete\\u post\\u链接,但没有任何回显。
<?php
$wpquery = new WP_Query(\'post_type=myposts\');
if( $wpquery->have_posts() ) {
while ($wpquery->have_posts()) : $wpquery->the_post();
$id = get_the_ID();
//just a test to see can I get post IDs and I get them
echo $id; ?>
<a href="<?php echo get_delete_post_link($id); ?>">Delete</a>
<?php endwhile; }
wp_reset_query();?>
这是输出<a href="">Delete</a>