Hence, ajax calls that must be triggered from within the wp admin
panel should be registered via thewp_ajax_{$action}
hook, and ajax
calls that are triggered from the frontend and have totally nothing to
do with wp-admin, but are like simple REST interactions of your
platform users with your platform server, should be registered via the
wp_ajax_nopriv_{action}
hook, no?
No.
wp_ajax_
is used for logged in users. wp_ajax_nopriv_
is used for logged out users. It has nothing to do with whether you’re in the admin panel or not. It’s only whether the user is logged in or not.
Related Posts:
- Admin Notification after save_post, when ajax saving in gutenberg
- Detecting post type within init action
- Ajax form submission from admin panel
- wp_ajax_[service] returning 0
- Is there a hook that fires before an ajax call?
- How to securely add an Ajax button to a WP Admin page?
- wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
- wp_ajax action is not running
- Conditional action hooks
- AJAX requests broken due to HTTPS for wp-admin
- Is there a hook to process a backbone restful PUT request inside wordpress?
- wp-admin AJAX with Fetch API is done without user
- Can I fire an add_action hook inside of a function that recieves data via wp_ajax?
- WordPress Ajax Problems
- WP Admin AJAX Security – using POST to include a relative URL
- WordPress Ajax Not Working ( Custom Admin page)
- Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?
- Which allowed API hooks work to add wp_ajax action?
- Pass additional parameter with async upload
- template_redirect or admin-ajax.php?
- Use WP admin AJAX url to hide API key
- Using admin-ajax prevents regular php form submission
- ajax problem – function on server is not called
- Preprocess submitted data
- How to check nonce lifetime value of plugins?
- Use AJAX in a WordPress Plugin to Get Data From Custom Database?
- admin-ajax.php returns 0 even when the post status code is 200 OK
- change wordpress pagination url after doing the request
- Refresh Gutenberg with JS for it show updated post
- Can I use application/json content type in WordPress
- Set cors header for ajax requests
- Is there a hook that fires after an ajax call?
- Content including hooks inside wp-settings.php are being called twice in WordPress
- Hook after all metadata are set is triggering several time
- wordpress admin ajax trash_comment
- Ajax call not working anymore
- WorddPress website admin part not working correctly – I think ajax/json issue
- Call public static method from ajax ‘wpcf7_mail_sent’ hook
- Why function called by admin-ajax executes synchronously?
- How modify comments metabox on post edit screen in WordPress?
- Weird admin-ajax.php problem
- WordPress Get Header and Footer using in Admin Area
- Trying to send AJAX data to WordPress hook
- get_comments() returns empty array if called through AJAX
- randomly get 400 error while user is logged in wp_ajax
- At what stage does wp_ajax hooks gets applied during WordPress request?
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- JavaScript implementation of Gzip
- WordPress AJAX with Axios
- Initialize JS with an ajax loaded ACF form
- Restrict access to admin but allow admin_post hook
- WordPress Nonce Issue for Ajax Login and Logout
- How to modify wp_ajax function?
- Vue.js + AJAX Shortcode
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- Can I edit the wp_post > post_content right before its inserted/updated?
- How do I set the url to make an ajax request for a html document?
- WP AJAX is not working, always returns 0
- Ajax stops working when logged in?
- WordPress ajax get content post id
- Populating content dynamically via AJAX and Advanced Custom Fields [closed]
- Create Page With wp_insert_post() and AJAX
- Get wp_title wp ajax
- Ajax custom search not functioning as expected
- Speed/Performance difference between `wp_ajax` and `init` checks for AJAX/POST requests?
- How to handle 400 status in Ajax [duplicate]
- Remove trailing 0 from function that is used both statically and dynamically
- How to load next and previous posts by Ajax
- WordPress ajax works on FF but not on IE & chrome
- Disallow second login session
- POST Ajax bad request
- Ajax for subscibers not working
- Restrict access to admin-post.php
- How do I add something to the “Edit Tag” page in wp-admin?
- Is there a better way of handling AJAX requests in WordPress?
- 200 return code on ‘POST /wp-admin/admin-ajax.php’ while NOT logged in
- i’m trying to get all my media query attachments via ajax in wordpress
- Distinguish between 2 instances of admin-ajax.php
- How to update post with Ajax (no plugin)
- Multiple wp_editor instances in custom post type using Ajax
- Ajax page load without reload
- Including ‘wp-load.php’ after another include() generates an error
- WordPress Ajax Page Load to skip embedded iframe
- edit user input data contact form 7
- How to keep scripts persistent during admin-ajax process when saving widget?
- jQuery ajax method does not return data
- WordPress 403 error on form submission with Ajax
- Download doccument on server rather than clients browser
- Load oEmbed iframe within ajax call
- Adding pagination to Ajax Query
- remove_action – pre_get_posts – does not restore original query
- Create secondary Archive page format?
- Get post details with pure javascript ajax
- Check get_post value after wp-admin login
- Ajax Security regarding user priviliges and nonces
- Use ajax without a plugin?
- Know which script/page is being called by ajax call
- Facebook Pixel + WooCommerce + AJAX = Confusion
- Send button using own contact form [closed]
- Add custom fields to specific menus