You can hook into the sortstop
event of the sortable
metaboxes, and read the current state:
jQuery( function( $ ) {
$( '.meta-box-sortables' ).bind( 'sortstop', function( event, ui ) {
var sortData = {};
$('.meta-box-sortables').each( function() {
sortData[this.id.split('-')[0]] = $(this).sortable( 'toArray' );
} );
console.log( sortData );
} );
} );
You can also hook into the events that hide or reveal metaboxes, but this requires some more work on your side, since WordPress does not provide nice events for this. See the postbox.js
script for more details.
There are other answers on this site that deal with the Ajax part.
Related Posts:
- Dashboard like meta boxes in my plugin – how to save their position and open/closed state?
- Rearranging Dashboard meta boxes with use of plugin/functions.php
- How to get Metabox custom field to show checked if value is updated using post meta query?
- ajaxurl not defined on front end
- Why does WordPress add 0 (zero) to an Ajax response?
- Add screen options to custom admin pages
- Get List of Registered Meta Boxes and Removing Them
- Saving data-URI to media library
- How to add tab which is visible only in admin side of product in woocommerce? [closed]
- Nonces can be reused multiple times? Bug / Security issue?
- How can I run AJAX on a button click event?
- Change default admin page for specific role(s)
- How-to implement admin Ajax inside an admin WP_List_Table?
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Empty POST data on server on AJAX request using Angular $http
- Using AJAX in FrontEnd with WordPress Plugin Boilerplate (wppb.io)
- Build path for a custom portfolio plugin
- Save metabox with multiple checkbox array
- Using AJAX in a plugin to submit form – REALLY confused
- wp_localize_script $handle
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- How to create Image gallery Metabox in wordpress [closed]
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- Adding callback function for wp_ajax_ has no effect
- Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
- get all products of one category
- Get returned variable from a function to add_shortcode function
- Plugin Settings not Saving on Ajax re-ordered table
- How to add meta boxes to the ‘Add new post’ screen?
- How to post form in ajax mode and handle it in wordpress
- Using Ajax call in jQuery doesn’t work in widget
- WP_LOCALIZE_SCRIPT doesn’t work
- Timeout on Admin-Ajax?
- Admin-ajax.php appending a status code to ajax response
- Plugin admin page meta_box toggle and order state not saving
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- Ajax in WordPress – path issue
- Cannot search post by taxonomy
- Best choice of options/settings framework for plugin/theme development
- WordPress Ajax callback function from plugin – OOP
- WP AJAX is not working, always returns 0
- Ensure function has completed before allowing another Ajax call
- How to create a Tools menu on the Network Admin dashboard from a plugin
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Show add_meta_box by selecting a specific category
- Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
- Fetching the value of forms in WordPress AJAX
- how do you prevent showing a particular category on the admin dashboard for specific user roles?
- include wp-blog-header not working on MAMP
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- update post meta for checkbox in the admin when inserted in the front-end
- Slow WP_query due to nested wp_query. Need Suggestions
- 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?
- Custom Taxonomy to dropdown box on adminside wordpress
- Example Dashboard Widget, Cancel not working
- Woocommerce checkout update totals with datepicker
- Including the necessary functions for a custom ajax registration form
- Create & Save multiple Meta-boxes
- Add a Save Button to Custom Meta Box [duplicate]
- 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”-named PHP file doesn’t get included
- Create a new post using rest api and save featured image using an external image url
- how to search users by ajax live search
- Getting List of all registered Dashboard Widgets
- what is the difference between these phares?
- wp.template() returns tags in Ajax response
- How do I update a field of a meta box?
- Storing data in wordpress database from ajax call from different website
- Input value from metabox is not found in $_POST after post save
- Fatal error: Uncaught Error: Call to undefined function get_option()
- Create custom HTML/JS app inside page
- Use just a shortcode from another page
- template_redirect or admin-ajax.php?
- Including comments meta box on a plugin page
- Avoid updating post when sending POST or GET request to post.php
- how to get context information inside my funcion
- How to add a widget to the post editing view?
- AJAX form post returns 0
- 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
- Adding admin menus to wordpress
- Can’t get AJAX call working in custom plugin
- Bad Request in AJAX
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- 400 Bad Request, in wordpress theme development, wp_ajax
- Ajax is not working in a loop
- 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?
- Automating the process of shortcode generation in a plugin – how is it done?
- insert query on a custom table using ajax with jQuery plugin Jeditable
- How to get error object returned by wp_create_user
- Plugin AJAX Save to Custom Table
- Meta box on options page save form problem