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?
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- Export data as CSV in back end with proper HTTP headers
- Nonces can be reused multiple times? Bug / Security issue?
- How-to implement admin Ajax inside an admin WP_List_Table?
- Show message on wordpress admin dashboard
- Using AJAX in FrontEnd with WordPress Plugin Boilerplate (wppb.io)
- How do you create a custom edit.php / edit pages page
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- 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
- Plugin Settings not Saving on Ajax re-ordered table
- How to put placeholder text in the main post input area?
- Admin-ajax.php appending a status code to ajax response
- Ensure function has completed before allowing another Ajax call
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- add a class when login
- Fetching the value of forms in WordPress AJAX
- Using the default wordpress uploader inside plugin
- maintaing consistent layout wordpress dashboard
- Replacing Scripts in Admin Load_Scripts
- Show special field when correct shipping is chosen
- .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?
- On cliking add new post redirect user to a custom page first
- How to localize admin.php only once
- get post attachment using ajax
- Create a new post using rest api and save featured image using an external image url
- Prevent third party plugin’s admin page access based on user type
- wp.template() returns tags in Ajax response
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Password field is empty when using wp_signon();
- Fatal error: Uncaught Error: Call to undefined function get_option()
- Using ReactJS in the WordPress admin for plugin development
- Use just a shortcode from another page
- How to load library scripts in admin from plugins in noConflict wrapper?
- Show error message after exception handled
- how to get context information inside my funcion
- Issue with contextual help overwriting existing content
- Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins
- AJAX form post returns 0
- Update Data parameter of a wp_localize_script() call
- Bad Request in AJAX
- ajax recursive calls on wordpress returning answers outsite the function scope
- Ajax submit result opens in admin-ajax.php
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Displaying “One Time” Notification in Plugins
- Are there any security risks when submitting data-attribute data through AJAX?
- insert query on a custom table using ajax with jQuery plugin Jeditable
- Plugin AJAX Save to Custom Table
- Filter for admin (back end) ‘reply to’ comment
- WP ajax requests not stacking?
- Is it possible to load the css just on my plugin admin page?
- jQuery UI tab does not work in the plugin page
- Why is the form not updating when I select a new sector from the list?
- Submit form to a different PHP file in the same plugin folder
- Plugin Form Submitting to admin-ajax.php instead of admin-post.php
- AJAX request not routing through proxy
- Remove Meta-boxes (Yoast SEO plugin) [duplicate]
- How to add text editor in plugin menu?
- How to make an admin plugin menu page go full screen?
- GET request return value as error instead of success
- How to control ajax calls without effecting memory of server?
- Forbidden Error in ajax call with wordpress
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- ajax stopped working when not logged in wordpress
- Add New Button in Admin Panel
- ajax call return 406 not acceptable for non logged users only
- Does $this context change in an AJAX callback?
- ajax response strips multidimensional array and unable to decode
- WordPress Ajax not returning Response
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Inserted data from database does not showing on front-page without referesh page?
- wp_ajax function return the html page
- $_SESSION inside php function executed by AJAX
- Two same AJAX calls – one is working, other doesn’t
- How To do Ajax In WordPress Custom Plugin?
- How to display properly exception or echo string after posting in plugin?
- WP Ajax on page load not working on bluehost but was working on Godaddy
- Get (eventual) permalink from post within Edit Post in Admin panel
- Ajax not working to insert, query and result data
- How to add conent (text) to Add New pages form of admin in WordPress
- Can’t get query string in ajax call
- Post data in wp-admin to external database
- admin page passing $_POST variables to itself
- Ajax url value to pass ‘variable’ to use in query
- An adiitional function fires on my AJAX submit
- Loading jQuery library from WordPress admin
- 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