Delete button on frontend
-
Hello, is it possible from the code I gave below to add a button to delete the post?
That is, the user can delete his posts<?php $current_user = wp_get_current_user(); $args = array( 'author' => $current_user->ID, 'orderby' => 'post_date', 'order' => 'post_date', 'post_status' => 'publish', 'category' => '1', 'posts_per_page' => -1 ); $current_user_posts = get_posts( $args ); //echo "<pre>"; print_r($current_user_posts); die; foreach ($current_user_posts as $post) { ?> <div class="containera"> <div class="text-blocka2"> <p><?php $category_detail=get_the_category($post->ID);//$post->ID foreach($category_detail as $cd){ ?> <?php echo $cd->cat_name; ?> <?php } ?></p> </div> <?php $image = get_field( 'field_5e1f6f6862891', $post_object->ID ); if( !empty($image) ): ?> <img alt="" style="width:600px; height:300px;" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> <?php endif; ?> <div class="text-blocka"> <h4><a href="<?php echo $post->guid; ?>" rel="bookmark"><?php echo $post->post_title; ?></a></h4> <p><?php the_field('field_5e1f6eb36288d'); ?></p> </div> </div> <br> <?php } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Delete button on frontend’ is closed to new replies.