You’re not printing anything from the AJAX callback. Trying using wp_send_json_success:
function ajaxtestdel(){
global $post;
$currentPdfs = get_post_meta( $post->ID, 'pdf_upload_url', true );
$postValue = isset($_POST['postid']) ? $_POST['postid'] : '';
$array_without_strawberries = array_diff($currentPdfs, array($postValue));
update_post_meta( $post->ID, 'pdf_upload_url', $array_without_strawberries );
// Send something back to AJAX
wp_send_json_success();
}
I have a feeling that perhaps your jQuery selector is incorrect for the fadeout – jQuery("#<?php echo $pdf; ?>")
what is $pdf
is it a valid id name?
Hope this helps!
Related Posts:
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Is There a WordPress Hook to Filter the Edit Posts View?
- What’s the point of using WordPress’s built in admin-ajax.php?
- Making menu link open in new tab?
- Cannot access wp-admin after disabling all plugin
- Edit default comments page in WP Admin
- All Users > User List > Update User Meta Field Inline
- Create tabs in admin options page from custom post type loop
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Add sub menu page in your plugin
- Create WordPress posts from JSON array using plugin in admin
- getting notifications about updates only in the “core” page
- Is there a better way of handling AJAX requests in WordPress?
- Ajax request sends url rather than data
- Calling PHP function with AJAX
- Ajax return 0 in plugin – ajax only used in wp-admin
- Getting 404 page not found error while trying to access add new plugin / themes
- admin panel save option with ajax
- Allow direct access to files/folders within WordPress to replace wp-admin
- Best collection of code for your 'functions.php' file [closed]
- Help making my pagination plugin better
- admin-ajax returning 400 error when request is made with Fetch API
- How can I log a user out of WordPress before the page loads?
- Bad Request (Invalid Hostname) on working server, database problem
- Errors while using ajax from external wordpress page
- I can’t access wordpress functions from an ajax php call
- Built in admin ajax hooks?
- Why would WP-CLI and WP Admin show different list of plugins with updates?
- Ajax with jQuery UI dialog not working
- Shortcode in AJAX popup
- Admin Dashboard with Custom Tab for Client
- Hide Theme options and Customize Admin menu
- Why none of the plugins that have ajax doesn’t work in my website?
- wordpress reusable content blocks
- How to provide a plugin which requires CMB2 (plugin dependencies)?
- How to send little data between admin pages of my plugin?
- Editing admin pages in WordPress [closed]
- Is this the right way to execute some PHP in my plugin after a button click on an options page?
- WordPress Ajax Posting from App
- How can I force users to a particular subdomain to log in for MU (Multisite)?
- Display update notification messages like ‘What’s New’
- Why WordPress plugin url ajax doesn’t work?
- Ajax call returning 0
- Ajax fail and get 504 error
- Is it possible make a back-end for WordPress with WordPress?
- Remove ‘Check Compatibility’ from Plugins menu
- Cannot access my wp-admin after installing Gzip compression [closed]
- Plugin settings won’t save changes
- Submit Form data to another page via Ajax (WordPress Way)
- PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content
- Odd /wp-admin/admin-ajax.php entries showing in Wassup
- Simply poll & Events Calendar plugins clashing
- don’t call ajax if not plugin page
- woocommerce search by sku and title ajax
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How to remove a CPT Menu from the Root Admin only
- How to include my Ajax calls in one function instead of calling different ones every time?
- Plugin permissions for Editor role
- Error: Can´t access facebook comment plugin admin page
- How to add an admin alert for missing plugins
- Using AJAX to run SQL statement and populate dropdown
- Gathering all Custom Post Type posts in to array/object the proper way
- Adding a jQuery modal dialog to the admin area
- Redirect plugin after form submit or show errors
- Need help creating asynchronous data scraper in WordPress
- Ajax call not working in wordpress through a plugin
- Ajax 400 error when used inside a plugin
- Strange admin-ajax / CSS / $_SESSION issue
- How to create admin setting for this small plugin
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function
- Hide all Admin Notices and move on a separate page
- Can we hide a certain user in WP?
- In a plugin, How to update a json file using ajax
- WordPress Dashboard add user password not working, etc
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- wp-admin/admin-ajax.php 400 (Bad Request) plugin
- AJAX update fails for public/non-admin users
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Ajax response returns html code instead of user data
- Conditional Fields depending on checkboxes
- Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
- Ajax call fails and returns [object Object]
- wordpress ajax pagination object value does not change
- How to enable Admins to see Plugins
- What’s the preferred method of writing AJAX-enabled plugins?
- using jquery serialize in ajax operation for plugin
- How to add php stylesheet to admin section instead of admin_head hook
- Like/Dislike Bar not working when updating
- Trouble Removing Plugin [closed]
- How to change response of admin-ajax request?
- How to create plugin list groups?
- Ajax not working for logged in users
- What is the recommended way to be notified of security updates to my plugins? [closed]
- Screen Options drop-down does not show
- plugin translations not reflected in admin dashboard
- Select posts from list and add them in a new list
- The Admin page isn’t showing in the sidebar of the dashboard
- Submitting form to admin-post.php WordPress
- Display Any Field fromAdmin Panel in Frontend via Shortcode?