You aren’t echoing anything so you aren’t going to get much of an AJAX response. All you are doing with AJAX, really, is loading a webpage with Javascript. If the page doesn’t print anything, you don’t see anything. You don’t need to return anything from AJAX but if you don’t you will have a hard time working out whether your action was successful.
If you need to get information back, even for debugging, just echo
it, or var_dump
it. You will be able to see your echo
ed or var_dump
ed content with FireBug. Be aware that if your AJAX content is supposed to be something like JSON this debugging hack will break it.
Also, it kinda looks like you expect an ID to come back from your AJAX call. You will need to echo that in the delete_pdf_and_metadata
function, or build a JSON object and echo that.
Related Posts:
- Getting the URL of the parent page
- Custom post type – use ajax to display sub pages
- Load Next Posts With AJAX not working with custom post type
- WordPress notification if new post published
- passing values from functions.php to template
- Display custom-post type based on the Title matching the current selected value
- How to submit the date with ajax?
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Collect custom post in a calendar
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- AJAX load more for different custom post type loops
- Ajax Custom Post Filter is not filtering
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- JS innerhtml changing style when using AJAX
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- CPT Template Not Showing – Getting 404
- Load Custom_post_type categories post with ajax
- Dynamic Custom Fields
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- Retrieve custom post types by custom taxonomies with WP_Query
- $post not working working in AJAX plugin with custom post type
- Load Next WordPress Posts With AJAX?
- Dynamically output a class to an anchor tag depending on what tag is chosen
- Why won’t this jQuery code work?
- Custom post type’s extra fields – how to handle?
- Custom Post Type Slick Slider “$ is not a function”
- Getting 400 Bad Request on AJAX Call
- admin-ajax.php GET custom-post titles
- Post will not load via ajax
- Select2 AJAX and WP Query Returns ALL and does not filter
- ajax response not recieving
- Getting a GET error in console – 404 not found for wp-json
- filter by custom taxonomy using ajax
- How to Query in WordPress which shows Alphabetic Posts?
- How do I update_post_meta() or add_post_meta() with an AJAX call
- Revert to previous dropdown options after change
- Creating a Tabbed Widget
- Multiple wp_editor instances in custom post type using Ajax
- How can I implement jQuery plugin correctly with my CPT?
- Masonry Append WordPress posts with singleMode
- Displaying information from custom field on custom post type
- I can’t connect my custom jquery to wp admin
- Change Post Meta via AJAX from the posts list table
- Weird issue where form field loses focus to previous form field even with JS disabled
- jQuery UI & Admin (Calendar)
- WordPress custom post type numeric pagination with ajax
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- WP_Insert_Post creating duplicate posts when logged in
- How to filter custom post type by multiple Taxonomies
- Not saving custom taxonomy while using ajax
- Search for custom field input of a custom post type in ajax live search
- Filtering posts based on three taxonomies
- WordPress next post by ajax call on button click
- Trying to list years (for a filter) but not all years display
- Use a template for a specific url slug without creating a page
- Disable button after one click per user per post
- Attend event form with ajax
- WordPress custom post type post item data – show/fetch only on click with Javascript dynamically?
- How to display custom post type pagination buttons when processing AJAX request
- how to display new private message to users?
- My post loop needs to have 8 different post templates
- Show ajax form resuslts in page
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Ajax load more inside custom post type taxonomy
- load wordpress events into full calendar jquery
- Is there a best practice, or typical way to do AJAX updating for data on a custom admin screen or post.php?
- Filtering custom post using Ajax and taxonomies, keep getting 0
- CPT not entering jQuery ready state
- Filterable portfolio in WordPress using jQuery isotope
- Fetch loop of custom post types with AJAX
- Calling in Post Content via AJAX
- jQuery tab_title already in use
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Toggle a metabox based on a selection
- Strange behaviour using 3.8.1
- CPT Template Not Showing – Getting 404
- Updating custom post meta with ajax
- CPT Template Not Showing – Getting 404
- Custom filtering on month value only of an entire date field
- Two different archive pages showing the same content
- Loops running into each other
- Add text to metabox input text field from Thickbox
- update custom taxonomy with Ajax in edit.php file [duplicate]
- Add a class to a menu item depending on a body class
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- How to filter custom post data with AJAX?
- Internal Server Error when echoing an OBJECT from wp ajax action function in functions.php to JS file
- Load posts via AJAX without draft status
- Appointment booking system in WordPress
- Issues with Ajax Pagination and Filtering
- Hide load more button if no more post in selected category
- Passing total post count to javascript
- Pull total post count for child category and parent if term ID
- get total post in category via ajx
- Default post showing more than intended
- Load more post with AJAX
- Get current post type within functions.php
- Search and filter terms of a custom post type only and display results