Try using these delete links instead. Yours don’t seem to be formatted right.
For delete:
$delLink = wp_nonce_url( admin_url() . "post.php", "post=" . $post->ID . "&action=delete");
For trash:
$delLink = wp_nonce_url( admin_url() . "post.php", "post=" . $post->ID . "&action=trash");
EDIT:
No try this instead:
$post_type = get_post_type($post);
$delLink = wp_nonce_url( admin_url() . "post.php?post=" . $post->ID . "&action=delete", 'delete-' . $post_type . '_' . $post->ID);
Related Posts:
- Is there a action hook for the “Empty Trash” button?
- Custom Post Types, slug, archive and SEO plugins
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Where does WordPress store the users customization in the theme
- delete post also attachments
- How do I create a featured post within a custom post type?
- how to enable different number of revisions for different blogs when using WPMU?
- Static posts page with home.php
- Unattaching images from a post
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- Using Custom Posts with Metaboxes and Drop-downs
- How to show featured image in custom post type dashboard post page
- Archive Page for Custom Post Type is not Working
- Posts vs. Pages
- Dynamic carousel on individual posts
- Filter Custom Post Type by Category with Ajax
- How to add pagination in between post and comments?
- Print all the tags from a custom post type Please
- Display multiple custom taxonomy values on single custom post types page?
- Show posts by a custom post author
- Custom loop pagination links not working
- wp-cli post create & media import issues
- Search results posts_orderby and ID
- Unable to restore from backup – how to obtain old blog posts?
- Getting value from get_post_custom
- custom post template file not shown, instead all the time 404.php
- Set Default Category to Username
- show custom post type category dropdown sorting result on same page
- Custom Post Type Rewrite To Include Parent Page(s)
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Dynamically switch template on click
- Custom taxonomy archive page problem
- Tell WP to use a specific template file in posts
- Two Custom Post Types with Identical Articles Competing for the same Slug
- Custom Post Type archive
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- if in category but only with post meta
- How to add convenient buttons for new custom post statuses
- Auto delete posts based on content text
- How to call posts under a specific category on static front page?
- Custom home page with full post for first one only
- Display value of custom field at the beginning of a post
- Optimize CPT-function with a loop
- Can WordPress handle following functionalities?
- How to display only one category in a custom post type?
- add_rewrite_rule and template redirect not working
- Custom post type slideshow background images to insert in a plugin
- Trying to exclude custom posts based on date, while sorting by custom field
- Changing permalink of WordPress
- Hook save_post_cpt not triggered when custom fields are modified
- Turn off display for custom sidebar post widget when on the post it’s displaying
- Alt text attributes not showing over portfolio images
- Adding an option to post editor to show a site disclaimer or message
- Added a ACF field to custom page and want the results to show as a column in admin
- WordPress Pods Custom Post Type – separate Media Upload folder for each custom Post Types
- Hide or remove custom post status
- Template for displaying CPT / Taxonomy URL issues
- Put page on Archived statut after end of publication date
- post and page and custom post type
- Loop through taxonomies and loop through their terms (Newbie question)
- My posts page is missing the page title
- Hiding title of selected post without plugins
- How can change header text in post careate/edit form
- Add Categories To Custom Post
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- how to redirect page after delete post inside a post page?
- Permalink base only for posts
- Custom post type – Loop out in random order but same 15 to appear first… still random
- Custom post type template not called
- Difference between modified post and new post
- How to use Categories of custom post type
- issue in wordpress auto delete post and redirect to another 1
- Static text above category page
- wp query custom orderby not custom field
- Customizing individual images on posts
- Custom Select Query pagination not working properly
- Custom Single Post Type not referring to single-post-type.php File
- Help with a function that will place a map pin for all posts
- Get new post meta data when (custom) post is saved
- Run Jquery Script after delete post in front end
- How do I control the fallback query after the original query returned cero posts?
- Adding The Post Template Dropdown to WP-Admin
- wordpress paginate, link to the right page
- “Current” class on a singular page menu item with custom post types?
- Given two custom post types: Automatically add meta fields from one custom post type to another
- Display metabox with date
- How can i retrive the movies, trailers, news in a single page using search
- Setting default category for display
- Choose options via url
- Custom Post Type Pagination 404 Error (if paged>=2) [duplicate]
- Display ONLY Latest Post From Several Categories
- get post custom value
- Automatically delete default posts and pages on theme install?
- How to Do Custom Fields to Output a Definition List
- custom post type single page template not working
- Taxonomy Category category.php not working
- Display post structure in function
- Dynamic Menu Item
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields