If you do not die
, execution will continue and might generate extra output which might break whatever information you are trying to send from the server to the browser. Strictly speaking, you might not need to die
, but there is very little point in taking the risk.
In more general terms, WordPress Ajax shows its age and the lack of experience working with Ajax when it was designed. You should use the WordPress JSON routes instead, as they can have a better URL structure, and the programming structure is more logical and modular.
Related Posts:
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Multiple ajax nonce requests
- Contact Form 7 Custom Post Action
- Update user meta using with ajax
- WordPress function that makes HTML safe to be sent via AJAX request
- AJAX vs Fragment Caching for W3 Total Cache [closed]
- Detecting post type within init action
- Delete row of custom table in WordPress using AJAX
- jQuery Autocomplete in WordPress
- Metabox cloning via Admin Ajax call issue
- Serving nonces through AJAX is not refreshing nonce, returning 403 error
- help on wp_editor via ajax load [duplicate]
- ajax and nonce when JavaScript is in a seperate file
- Prevent wp_debug from polluting ajax within plugin
- How to allow to user non logged in WP system upload in media library?
- WordPress function to get term or post object by id
- Buddypress ajax problem after adding new groups sub nav [closed]
- How to check username availability with ajax at registration
- Conditional success callback based on Ajax Response not working
- Can a wp_nonce created from domain 1 to be verified on domain 2?
- admin-ajax.php slow, how to speed it up?
- How to use several wp_ajax_ functions for different queries?
- Three level taxonomy dropdown frontend
- I’m getting a 401 while calling the wp-json endpoint via ajax
- Unable to parse JSON response from wp_send_json_success [closed]
- problem with WordPress ajax
- How to set post_id to 0 when you upload image via Add media button. (async-upload.php)
- Ajax simple experiment
- How to load new text widgets and polls into the sidebar without reloading the page?
- How to make tabulator ajax call in wordpress?
- How would you update a frontend form with AJAX
- Updating User Meta with Array on Click of Button AJAX
- Radio buttons live refresh in the customizer
- Admin ajax add tag callback
- Stop auto load wp-admin admin-ajax.php
- wp_enqueue_script() doesn’t work with AJAX
- Dynamically add more fields/remove last field in a form
- Ajax Request for both logged and non logged users
- Ajax Multi Response Problem
- AJAX call inside plugin class not triggering
- Custom AJAX Endpoint not returning any result
- Contact form 7 Hide response messages after 5 seconds
- WordPress Heartbeat API cannot parse data
- how should i get json encoded data from wordpress ajax action page
- Cache plugins and ajax nonce verification
- Ajax function on #publish only saves as draft – how to make it publish?
- AJAX call broken after actualization
- WP_Ajax Hook doesn’t execute this PHP code
- Ajax function not returning any results
- post values to custom post type which has advanced custom fields
- ajax problem – function on server is not called
- wp_mail doesn’t work when logged in?
- How to continuously send feedback via AJAX responses to my client?
- Need help with Access-Control-Allow-Origin
- Send email via ajax
- wp_ajax handler with multiple class instances
- admin-ajax.php (aborted) error when using jQuery.get
- Storing temporary data for a custom post type
- I get a 0 after the result of my ajax requests
- Load page HTML content through AJAX
- Not getting an ajax readystatechange on my page
- Sharing variables in both actions wp_footer and wp_ajax
- Display full WordPress post under search form using AJAX
- Ajax callback not work
- WordPress Select Option Load Custom Fields
- Add ajax to plugin in admin area
- Search live Ajax
- jQuery.post returns 0
- Ajax login fails: script sets cookies, but is_user_logged_in() returns false
- Using wp_send_json_success instead of $result[‘message’], die, etc
- Opening Modal popup on Ajax form submission
- Ajax sometimes work and sometimes just don’t work
- admin-ajax error 400
- wordpress admin ajax trash_comment
- Javascript output now showing in custom widget
- Ajax call on class returns old data
- how to correctly use json_encode with ajax
- delete post meta data in array WordPress
- How to trigger lost password email using REST API?
- Display post thumbnail after clicking on post id with AJAX
- How to block search engines indexing certain AJAX actions
- Error while submitting form using AJAX and php
- How to fetch meta_value and meta_key in matrix after ajax request by post_id
- wp_ajax_action, wp_ajax_nopriv_action not working
- Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC
- Is it a good idea to init ajax functions only while ‘DOING_AJAX’
- register_setting and AJAX?
- ajax response is 0 instead of ‘script’ [duplicate]
- using ajax to query sql
- A refreshless WordPress website
- Dynamic dependent select box getting null value
- get_template_part() does not render after the ajax request
- How to get data with Select AJAX PHP
- Add “load more” functionality to an AJAX response
- weird Internal Server Error – no error log produced
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- Successful ajax call returns lots of whitespace and text of code with 0
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?