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?
- Blocking admin-ajax.php from outside domain
- wp-admin/admin-ajax.php 400 Bad request (chrome console)
- contact form 7 form not working in admin panel
- How does the security of admin_ajax.php work?
- PHP “php://input” vs $_POST
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- How to solve the error “SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.” in IE
- Show spinner GIF during an $http request in AngularJS?
- Refresh HTML Page in Browser Automatically on Timer – Every 15 Min
- JavaScript implementation of Gzip
- jQuery: Performing synchronous AJAX requests
- ASP.NET MVC controller actions that return JSON or partial html
- jQuery’s .on() method combined with the submit event
- Ajax takes 10x as long as it should/could
- How to check if I am in admin-ajax.php?
- Best way to end WordPress ajax request and why?
- How to load wp_editor() through AJAX/jQuery
- How to cache json with wp-super cache
- Load minimum WordPress environment
- Why use wp_send_json() over echo json_encode()?
- Why use admin-ajax.php and how does it work?
- How to get a unique nonce for each Ajax request?
- Open a Thickbox with content trough AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Admin ajax request return 0 with die()
- Why not register shortcodes if is_admin dashboard?
- WordPress AJAX with Axios
- Why is die() used at the end of function that handles an Ajax request?
- Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
- Making my AJAX powered WordPress Crawlable
- Is there a JavaScript API? How to access public and private data in JS?
- Get Previous & Next posts by Post ID
- failed to load wp-admin/admin-ajax.php
- Using Backbone with the WordPress AJAX API
- Using Ajax with a Class file
- Ajax in a settings page (update_option is undefined)
- How to pass data parameter to ajax action function handler
- WordPress Ajax Data Security
- Making Custom Fields Standard in the Admin UI
- add_action(‘wp_ajax_[action name]’, myfunction) problem
- Displaying PHP Errors from admin-ajax.php
- wp_set_auth_cookie() doesn’t work in Ajax call
- gettext does not translate when called in ajax
- Execute one AJAX request after another AJAX request finished
- Custom column for changing post status via ajax
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- Ajax and autocomplete
- How to influence the information displayed on widget inside wp-admin
- How to add to cart via AJAX Woocommerce [closed]
- Nonces and Cache
- WordPress 4.8: Using multiple WYSIWYG-Editors with media inside of Widgets how to?
- SSL breaks customizer: page isn’t returned from ajax