Change your wp_localize_script-Call to the right Action:
wp_localize_script( 'addItemToNav', 'menuItems', array(
// URL to wp-admin/admin-ajax.php to process the request
'ajaxurl' => admin_url( 'admin-ajax.php' ),
// generate a nonce with a unique ID "myajax-post-comment-nonce"
'postCommentNonce' => wp_create_nonce( 'update_nav_items-nonce' ),
'action' => 'wp_ajax_update_nav_items'
)
);
As ‘action’ you currently Input the function Name, but that is wrong. Your registered Action to call the function has an different Name.
Related Posts:
- Submit Form data to another page via Ajax (WordPress Way)
- Ajax call to php function doesn’t work PHP code
- Frontend AJAX Request causes Error: ‘Call to undefined function add_action’
- AJAX login without a plugin does not work. when add a action to function.php
- How can I edit post data before it is saved?
- Help making my pagination plugin better
- admin-ajax returning 400 error when request is made with Fetch API
- How can I log a user out of WordPress before the page loads?
- How to pass JavaScript variable to PHP in wordpress widget?
- jQuery AJAX call not executing in Plugin
- Errors while using ajax from external wordpress page
- Built in admin ajax hooks?
- How to remove action from plugin?
- delete_user_meta Delete one value out of array
- How to use wp-ajax in wp-cron
- Calling shortcode in wp_localize_script strips result
- how to use ajax to display from database and load more in wordpress plugin
- How to add inline css/js inside a shortcode
- Ajax with jQuery UI dialog not working
- Shortcode in AJAX popup
- What is the purpose of $merged_filters?
- add action wp_head not working
- What are the benefit in adding hook in the init() hook?
- Why none of the plugins that have ajax doesn’t work in my website?
- Why do plugins that cause ‘unexpected output’ create AJAX problems?
- Where to hook my plugin’s action
- AJAX button run function
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Get posts from WP_Query and format them on admin_head
- WordPress Ajax Posting from App
- How to get all of the activate_plugin action parameters?
- Using a custom plugin to capture input data via Ajax and PHP
- Ajax contact form widget plugin data not insert in database
- Why WordPress plugin url ajax doesn’t work?
- AJAX in plugin wp_send_json() sending html
- Removing an action from wp_footer called in a class that’s inside a bigger class
- Ajax call returning 0
- Ajax fail and get 504 error
- Create tabs in admin options page from custom post type loop
- External Script Using WP – Hooks / Actions Not Working?
- What is @Action in WordPress?
- _prime_post_caches in wordpress
- How passing values to construct function with Actions?
- add_action into another add_action not working
- a weird attribute on every html tag
- Why do plugins often ask to add in to templates?
- wordpress add_action() issue in ajax call
- How to get menu location in wp_update_nav_menu hook
- PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content
- don’t call ajax if not plugin page
- woocommerce search by sku and title ajax
- Where Should i write the code for wordpress ajax voting?
- Advanced WordPress plugin activation detection
- how to execute some code after a post is published in WordPress [duplicate]
- Add action to custom Function
- Using conditional staements to load plugins
- Ajax Call in page theme not working?
- Using AJAX to run SQL statement and populate dropdown
- Problem with ajax plugin for refreshing posts
- Need help creating asynchronous data scraper in WordPress
- Ajax call not working in wordpress through a plugin
- Ajax 400 error when used inside a plugin
- Strange admin-ajax / CSS / $_SESSION issue
- wp_query ‘s’ parameter does not work with WC_AJAX
- Jquery POST Ajax Return null data in wordpress
- In a plugin, How to update a json file using ajax
- Ajax Call not Working in Plugin
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- Hooking into the HTML header container
- How to use Datatable with Ajax when creating plugin on WordPress?
- wp-admin/admin-ajax.php 400 (Bad Request) plugin
- how can I edit the HTML of yith ajax product filter
- AJAX update fails for public/non-admin users
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Remove action added in plugin class from theme
- {status}_{post_type} does not run correctly?
- Conditional Fields depending on checkboxes
- 504 Timeout gateway when trying to pay for an order in Woocommerce. What else can I do?
- Help with customising love it plugin (use within foreach)
- Ajax call fails and returns [object Object]
- wordpress ajax pagination object value does not change
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- What’s the preferred method of writing AJAX-enabled plugins?
- Plugin Hook: Get posts
- using jquery serialize in ajax operation for plugin
- Action hook “wp_insert_post” works but not for last imported post
- Like/Dislike Bar not working when updating
- Ajax Not Working If The Handler is Located Outside Plugin Submenu Page Function
- Build and ajax plugin not work
- Problem with executing a function on saving a post
- OOP Plugin: Where should I place the action hooks in the class?
- Trouble Removing Plugin [closed]
- How to change response of admin-ajax request?
- Ajax not working for logged in users
- Advanced Ajax Page Loader and Masonry Grid
- How to create load more button without a plugin?
- Ajax Called in Plugin php file
- Ajax Load More stopped working (Plugin with repeater template, shows hidden Button)
- How do I call an action hook into wp_ajax hook callback function