You can’t hook an AJAX action from within a shortcode, and the constructor for Wp_Lbs_Calendar
is only running inside your shortcode.
This means that the actions are only hooked to wp_ajax_
when your shortcode is used on the page. But the AJAX request is a separate request to admin-ajax.php
, and your shortcode is not running on on that page, so the actions are not hooked and will not run.
Your add_action()
s for AJAX need to be hooked in a place that lets them run on every page load, so that the handler is available on admin-ajax.php.
Related Posts:
- How to do admin ajax request in a plugin for rest api
- wp_ajax add_action fuction won’t fire on custom jQuery action
- How to create an API for my plugin?
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- How do you use the plugin boilerplate loader class to hook actions and filters?
- add_filter OO with parameters
- How do I print a notice only on certain admin pages?
- Do I need to call do_action in my plugin?
- Using AJAX in FrontEnd with WordPress Plugin Boilerplate (wppb.io)
- How Do I Load My Action Earlier Enough?
- Which to use to execute code during the saving of a plugin settings page?
- Does WP fire delete_post when trashed posts are automatically deleted?
- Build path for a custom portfolio plugin
- Using AJAX in a plugin to submit form – REALLY confused
- What action is called when drafts are saved?
- Adding callback function for wp_ajax_ has no effect
- get all products of one category
- How can I hook into existing WordPress Bulk actions?
- Get returned variable from a function to add_shortcode function
- How to add custom content under plugin row in WordPress admin plugin list?
- WP_LOCALIZE_SCRIPT doesn’t work
- Admin-ajax.php appending a status code to ajax response
- Define a function outside a class and call the function using action or filter hook
- Create a plugin to change the action to which a function is hooked
- Cannot search post by taxonomy
- WordPress Ajax callback function from plugin – OOP
- admin_notices not displaying in plugin
- WP AJAX is not working, always returns 0
- Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
- Getting admin notices working for plugin errors
- Fetching the value of forms in WordPress AJAX
- An echo line in a transition_post_status action leads to “cannot modify header information – headers already sent by”
- Show special field when correct shipping is chosen
- Tried in different ways but sidebar not working?
- conditionally load javascript & CSS for do_action() calls from plugin
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- How to localize admin.php only once
- Adding rewrite rule dynamically
- How to hook a custom user function to a wordpress core ajax action?
- Create a new post using rest api and save featured image using an external image url
- Unable to change footer using wp_footer action hook
- wp.template() returns tags in Ajax response
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Create custom HTML/JS app inside page
- How to filter content for specific content variable
- Use just a shortcode from another page
- I have 2 plugins using the same wp_login action hook and one is not working
- Valid filenames for add_action’s first parameter
- WordPress class, using add_action to call member function does not work
- Where do I put my add_action(… and add_filter(… and do I need to remove them?
- How dynamic action login_form_{action} is working
- How to get all queries’s results after they have executed?
- Update Data parameter of a wp_localize_script() call
- 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
- 400 Bad Request, in wordpress theme development, wp_ajax
- ajax recursive calls on wordpress returning answers outsite the function scope
- Ajax submit result opens in admin-ajax.php
- Are there any security risks when submitting data-attribute data through AJAX?
- A question about add_action()
- How to get error object returned by wp_create_user
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- WP ajax requests not stacking?
- AJAX button with success callback. (Titan Framework)
- ajax working when function is on child theme but not in plugin page
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- add_action wp_ajax_ not loading in plugin file WP Network
- wordpress automatic update does not run
- Ajax +wordpress onClick link redirect to new page and create html content
- How Can I Add Code To A Preexisting Function Without Editing it
- Setting post_id for single.php based on URL without a redirect
- Get cat parameter from admin-ajax
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- Action / Hook when a new plugin is added
- apply_filters() and call_user_func() to define and call a function outside a class
- 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
- Bad request 400 using class based files
- Post is uncatagorized in publish_post action
- Performing ajax request in wordpress
- ajax multiple Values
- Using JavaScript in WordPress page to call for server data using AJAX
- Ajax Response Error | just getting error as the response
- admin-ajax.php returns “No Script Kiddies!” sometimes
- Ajax functionality not being called under wordpress plugin
- Array/List Edit in Backend
- Does WordPress have something like timer hook?
- WP Cron as Fast as WordPress AJAX?
- WordPress plugin: admin-ajax.php not passing data to custom function
- Ajax url value to pass ‘variable’ to use in query
- Ajax functions – no access to wp-admin.php only online
- How to remove a class [closed]
- Apply function on all action hooks?
- 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?
- WordPress plugin boilerplate AJAX functionality
- Ninja Forms: Front-End Forms, Post ID?