The dynamic wp_ajax_
hooks serve mostly organizational convenience on PHP side.
You could choose not to use it, then you would probably have to:
- hook into
admin_init
- check that
DOING_AJAX
istrue
- check that request (
$_REQUEST['action']
and rest of it) is your special kind of request
Then either process your request and die()
or let anything else through to normal handling.
Related Posts:
- Using Backbone with the WordPress AJAX API
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- Including WordPress in RESTful API
- REST API endpoint for elasticpress autosuggest
- Admin Notification after save_post, when ajax saving in gutenberg
- Detecting post type within init action
- Gutenberg – how to correctly perform ajax request on backend
- wp_ajax_[service] returning 0
- Is there a hook that fires before an ajax call?
- AJAX request from Chrome Extension to WordPress Website
- WP REST API route request explain
- wp_ajax action is not running
- Confused on AJAX submit form through page template
- Conditional action hooks
- Solve cors problem using rest api or ajax
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- Can I fire an add_action hook inside of a function that recieves data via wp_ajax?
- How to check an ajax nonce in PHP
- WordPress Ajax Problems
- How to add WP API and JS featured image attachment
- how to send Ajax request in wordpress backend
- Identical wp_rest nonce returned from rest_api
- How do I get reusable blocks via frontend REST API?
- Is there builtin way to use protected AJAX endpoint?
- rest_no_route custom route
- Test WordPress api with postman
- Which allowed API hooks work to add wp_ajax action?
- How to load content from many posts on a page, only if needed
- How do I query posts by a sub value with the API?
- Mapping Backbone Models to serialized array in wp_options table
- merge wp rest api query to get posts per category does not work
- Ways to load admin-ajax faster without initializing all plugins?
- Using admin-ajax prevents regular php form submission
- How to make a fetch() POST request to wordpress rest api?
- post values to custom post type which has advanced custom fields
- ajax problem – function on server is not called
- i’m trying to get all my media query attachments via ajax in wordpress
- change wordpress pagination url after doing the request
- REST public POST giving 403 forbidden nginx
- Refresh Gutenberg with JS for it show updated post
- Set cors header for ajax requests
- Is it good practice to use REST API in wp-admin plugin page? [closed]
- Is there a hook that fires after an ajax call?
- Content including hooks inside wp-settings.php are being called twice in WordPress
- 404 error custom post type rest api
- Hook after all metadata are set is triggering several time
- How to require files in a custom endpoint
- Create a post with REST API and adding a category
- Call public static method from ajax ‘wpcf7_mail_sent’ hook
- Why function called by admin-ajax executes synchronously?
- Should I edit a user meta field with PUT, PATCH, or POST and WP::Editable
- How to trigger lost password email using REST API?
- Trying to send AJAX data to WordPress hook
- WordPress blocking polling request when signed into Admin
- how reduce fetch/XHR response time
- Custom WP rest api endpoint only working on non https?
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?
- WordPress REST API FormData: Form Not Submitted When No Files Attached
- register_rest_route to send via ajax as guest results to 403
- Cannot add multiple single images at once
- Error while submitting form using AJAX and php
- How to send custom variable in Media Uploader ajax request?
- AJAX save options inside class
- Enqueue dynamically generated javascript
- How to test if in dashboard, bypassing Ajax quirk
- AJAX call in backend results in empty update_option
- Ajax Comment: Page reloads whenever the comment submission form is reloaded
- Native WordPress Video Shortcode Not Working After Post is Loaded via Ajax
- Use ajax without a plugin?
- Ajax Function call is always returning 0 in front end(without plugin) [closed]
- WP-API + JS Backbone client – how to update post meta
- Deploy Subcategories with Ajax not working
- Allow guest to update custom post met using ajax
- $_POST empty in using new php file added to theme
- AJAX Post from same domain to a wordpress page
- WordPress Ajax JSON success return no being recognized
- How to fetch meta_value and meta_key in matrix after ajax request by post_id
- Can Ajax Action [add_action(‘wp_ajax_{action_name}’, ‘{action_name}’] be hooked into wp hook
- Weird admin-ajax.php problem
- First time doing Ajax with WP, how to do it?
- Ajax contact form returnig 0
- Strange AJAX problem (SOMETIMES works in Chrome/FF, ALWAYS works in Midori)
- Session variables lost during Ajax calls – WordPress – Sage Starter Theme
- Unexpected WordPress search results
- How to check for dependencies for a specific page and enqueue them
- wp_ajax_action, wp_ajax_nopriv_action not working
- WordPress Get Header and Footer using in Admin Area
- Simulate a specific page when making AJAX calls
- Tie the sending of an ajax request to WordPress hooks
- How to use nonces for frontend AJAX voting if the page gets cached?
- Know which script/page is being called by ajax call
- Ajax live search, “No products found” when the title contains apostrophes and quotations
- Get Page Type (Category/Tag) Using AJAX
- AJAX: admin-ajax.php is adding extra content to my script’s response – how to exclude header, footer, etc.?
- Add Ajax loaded posts to existing posts
- wp_enqueue_media problem
- WordPress page content only in fancybox except direct click
- Ajax takes 10x as long as it should/could