So now I want to refresh the page using a success callback. I’ve
enqueued a simple script via admin_enqueue_scripts:
I believe in that script, you need a global JS function
named ajax_success_refresh
, as in the following example:
// This is the 'success_callback' for the AJAX action of 'yyy_reset_security_logs'.
function ajax_success_refresh() {
window.location.reload( false );
}
Hint: Since it’s a global function
, you should make the function name as unique as possible.
Related Posts:
- WP AJAX is not working, always returns 0
- 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?
- 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 add an image upload field directly to a custom write panel?
- ajaxurl not defined on front end
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How do i best handle custom plugin page actions?
- Why does WordPress add 0 (zero) to an Ajax response?
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- Saving data-URI to media library
- Export data as CSV in back end with proper HTTP headers
- Nonces can be reused multiple times? Bug / Security issue?
- How can I run AJAX on a button click event?
- Completely remove WP_Admin_Bar for specific user roles
- How-to implement admin Ajax inside an admin WP_List_Table?
- API to trigger prompt on leaving page
- Show message on wordpress admin dashboard
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Empty POST data on server on AJAX request using Angular $http
- Hook the Keydown Event in the TinyMCE Post Editor
- Using AJAX in FrontEnd with WordPress Plugin Boilerplate (wppb.io)
- 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?
- How do you create a custom edit.php / edit pages page
- Cancel post save
- 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
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- WP Cron doesn’t save or in post body
- Create a clickable name in WP_List_Table for Plugin Admin
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- URLs of plugin resources?
- Adding callback function for wp_ajax_ has no effect
- get all products of one category
- Get returned variable from a function to add_shortcode function
- Problems with removing admin bar
- Plugin Settings not Saving on Ajax re-ordered table
- 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
- How to add custom content under plugin row in WordPress admin plugin list?
- WP_LOCALIZE_SCRIPT doesn’t work
- How to put placeholder text in the main post input area?
- Timeout on Admin-Ajax?
- Admin-ajax.php appending a status code to ajax response
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- 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
- WordPress Ajax callback function from plugin – OOP
- Ensure function has completed before allowing another Ajax call
- Add notification bubble notice in navigation using transients
- Can I individually style items in the backend widget list?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
- add a class when login
- Add a panel to edit post
- Where should I put “run once” plugin pages?
- Fetching the value of forms in WordPress AJAX
- Using the default wordpress uploader inside plugin
- Modify users.php page to create page/post on button clicked
- Issue plugin commands in admin settings page
- include wp-blog-header not working on MAMP
- maintaing consistent layout wordpress dashboard
- Replacing Scripts in Admin Load_Scripts
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- Slow WP_query due to nested wp_query. Need Suggestions
- Show special field when correct shipping is chosen
- Problems with: manage_${post_type}_posts_columns
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- Global State During an Admin Post
- Woocommerce checkout update totals with datepicker
- Including the necessary functions for a custom ajax registration form
- Render content after post title in wp-admin
- On cliking add new post redirect user to a custom page first
- 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
- get post attachment using ajax
- Dashboard – get status and position of metaboxes and pass them to ajax method
- Create a new post using rest api and save featured image using an external image url
- how to search users by ajax live search
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- Prevent third party plugin’s admin page access based on user type
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- wp.template() returns tags in Ajax response
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Admin – Handle data before creating or updating a post, page or custom post
- Storing data in wordpress database from ajax call from different website