The problem is where you place the add_action of your wp_ajax_*
Try to put it at the start of everything, and ensuring that it is being loaded in a /wp-admin/ route.
Try your url: http://xxx/wp-admin/admin-ajax.php?action=your_action until it gives you something different than zero.
Related Posts:
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- template_redirect or admin-ajax.php?
- 400 Bad Request, in wordpress theme development, wp_ajax
- Data not insert and update through ajax and jQuery in admin page?
- AJAX button with success callback. (Titan Framework)
- Best practice for plugin: always detect admin-ajax call?
- Get cat parameter from admin-ajax
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- How can I run AJAX on a button click event?
- Completely remove WP_Admin_Bar for specific user roles
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Empty POST data on server on AJAX request using Angular $http
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- how to use thickbox in admin?
- Build path for a custom portfolio plugin
- Add a jQuery function to admin pages
- Using AJAX in a plugin to submit form – REALLY confused
- wp_localize_script $handle
- WP Cron doesn’t save or in post body
- Create a clickable name in WP_List_Table for Plugin Admin
- How to post form in ajax mode and handle it in wordpress
- Check if I am in the Admin Panel (wp-admin)?
- Using Ajax call in jQuery doesn’t work in widget
- WP_LOCALIZE_SCRIPT doesn’t work
- How to load the plugin only when logged in?
- How to redirect to action on custom page within admin section
- Ajax in WordPress – path issue
- Cannot search post by taxonomy
- Add notification bubble notice in navigation using transients
- Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
- Add a panel to edit post
- Where should I put “run once” plugin pages?
- Modify users.php page to create page/post on button clicked
- Slow WP_query due to nested wp_query. Need Suggestions
- Problems with: manage_${post_type}_posts_columns
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Admin – Handle data before creating or updating a post, page or custom post
- Storing data in wordpress database from ajax call from different website
- wp_filesystem put_contents issue with owner/group
- Create custom HTML/JS app inside page
- Create tabs in admin options page from custom post type loop
- Enqueue script globally
- WordPress Admin Login Custom Logo
- jquery & ajax sending data to php
- wp_localize_script is not adding a global variable for javascript
- Can’t get AJAX call working in custom plugin
- Ajax is not working in a loop
- How to import the css in the plugin admin area?
- How to get error object returned by wp_create_user
- Wp-admin Custom User Management
- Admin Subpages without Menu entry
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- ajax working when function is on child theme but not in plugin page
- Is there a better way of handling AJAX requests in WordPress?
- About a programming language starts with [closed]
- How do I force a download in the admin area?
- add_action wp_ajax_ not loading in plugin file WP Network
- Workflow for new importer plugin – your advices?
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Ajax +wordpress onClick link redirect to new page and create html content
- Remove Permalink Meta Box not working?
- How do I duplicate a single post, with all its properties, and save it as a different post?
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- How to do admin ajax request in a plugin for rest api
- Ajax action has 200 status but response of No response data available for this request
- Jquery php request is returning a weird result
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook
- Posts form with AJAX request – Plugin development
- WordPress admin panel not working
- Bad request 400 using class based files
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- I cant add is_admin control to plugin
- Rate limiting ajax requests in WordPress
- ajax-action.php can’t find added action
- AJAX call of function containing javascript which is not loaded (Plugin development)
- ajax multiple Values
- Change Label of custom post type
- How to include files in the loop via ajax
- How to handle ajax Request in a complex-structured plugin?
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- Ajax Response Error | just getting error as the response
- Stop unauthorised file access
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Redirect with message after admin_post.php
- PHP includes with AJAX actions
- admin-ajax.php returns “No Script Kiddies!” sometimes
- WordPress function is not called and ajax return 0
- Ajax functionality not being called under wordpress plugin
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Forcing ALL plugin Admin menus into a separate menu
- WordPress plugin: admin-ajax.php not passing data to custom function
- Page reload occurs before request finishes
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- How to prepend a header section to all pages related to my WordPress Plugin
- WordPress plugin boilerplate AJAX functionality