From codex: wp_ajax_{$action} and wp_ajax_nopriv{$action}
the dinamic part {$action} must be the same name as the function, so instead of:
add_action( 'wp_ajax_the_ajax_hook', 'the_action_function' );
add_action( 'wp_ajax_nopriv_the_ajax_hook', 'the_action_function' );
do:
add_action( 'wp_ajax_the_action_function', 'the_action_function' );
add_action( 'wp_ajax_nopriv_the_action_function', 'the_action_function' );
Related Posts:
- AJAX on Front-End Button Click not working – Custom Plugin
- How to handle WordPress Plugin Front-end AJAX Call [duplicate]
- How to request admin-ajax.php correctly when wordpress URL and site URL are different?
- AJAX doesn’t pass variables to the php function in the plugin
- How to load wp_editor via AJAX
- Let readers suggest edits from the frontend
- How can I pass a variable to wp_ajax action?
- Loading shortcode with ajax
- Add image to post from external URL
- How to notify users of blog updates a la Admin Plugin Update notifications?
- How to add a sub menu with AJAX?
- Create Proper WordPress Ajax Request in JavaScript, NOT jQuery
- Execute a function using ajax
- Problem running Ajax in WordPress
- What’s the point of using WordPress’s built in admin-ajax.php?
- Frontend editing, Frontend user dashboard
- How can I reuse the WordPress search form for a custom plugin / widget?
- AJAX image upload with a upload progress bar using media_handle_upload
- jQuery Plugin to use WordPress functions in AJAX request
- Ajax gives 400 error
- WordPress Ajax Callback
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Shortcode button dosent work for all posts. Work for first post only
- When to use action hooks and plugins
- Simple ajax call not working in wordpress plugin
- Implement Autocomplete for a custom field on WordPress Plugin Frontend
- Form isn’t inserting data into database with ajax plugin
- What’s the best way to implement AJAX in WordPress?
- How to put JQuery/Ajax inside shortcode?
- Show an image in my header.php
- __callStatic method handler passed to add_action causes bug in PHP
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Ajax with plugins returns 0
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- Using AJAX to generate front end / viewer end pages
- Post Comments with Ajax in WordPress
- AJAX search as you type? [duplicate]
- WordPress api call using wp-ajax returns error 400
- Add script into front from my plugin
- Fullscreen Video/GIF Intro
- Render Modula Plugin Shortcode On Ajax Request
- AJAX Load more start with x posts
- Is it safe to use admin-ajax.php in the frontend?
- Create WordPress posts from JSON array using plugin in admin
- Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this plugin
- WordPress front end AJAX. Return 0 :?
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Proper way to handle admin-ajax calls
- Using custom php file for ajax url inside plugin
- Asynchronous request in wordpress
- How do I localize admin-ajax.php that is used in Ajax Load More – Infinite Scroll?
- Ajax object not defined – JS file is in plugin folder
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- Call Ajax URL in Plugin
- Calling a class method instantiated by ajax call in wordpress [closed]
- Loading by Ajax a plugin that also uses Ajax
- Categories from front-end, checkbox selection doesn’t work
- How to call php file in theme directory from plugin
- Effeciently adding Checkboxes to TablePress table cells
- How can I adjust my function so the page editor still loads in the backend?
- Push Contact form 7 variable to front end after submission
- Error datatable whit ajax
- Facing Problem with admin-ajax.php URL – Getting 404 with AJAX call
- Trouble with AJAX using GET
- WP Ajax DB issues
- Calling PHP function with AJAX
- jQuery Ajax not loading page with ACF fields
- How achive serving multiple concurrent Ajax / Rest calls in plugin?
- How To Toggle User_Meta in frontend in a form using PHP
- How to upload PDF from Front-End and post automatically?
- Update User Meta Via Ajax
- User Following System
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Overwriting Plugin’s Ajax callback function from theme
- cURL do not mimic click
- What action or filter can I use to change all the html returned from server for a page?
- admin-ajax.php not working properly on subdomains
- What action/hook do I need to register to have my plugin handle front-end editing?
- My ajax request don´t work and return 0
- Plugin with AJAX on subdomains causes 404 in console
- WordPress update plugin through Dashboard/Plugins displaying error
- How can I use wp_ajax_response for front-end error reporting?
- display user input using ajax in wordpress
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- Contact Form loaded with Ajax
- How to load a plugin when doing an Ajax call? [duplicate]
- WordPress plugin ajax post parameter
- admin panel save option with ajax
- Capturing POST data
- Pulling Advanced Custom Fields from other pages
- Get a submitted value from front end post form for single template
- Response from Php File to Ajax is not getting sent
- Plugin Admin Page Ajax-Admin call returning 0, URL set correctly. Implemented localized scripts but did not fix it
- Load css classes after using ajax calls
- map urls to plugins
- How to make a rest style plugin?
- WordPress portfolio pagination on home page
- wordpress Ajax success doesn’t return the value