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
- 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)
- Empty POST data on server on AJAX request using Angular $http
- wp_localize_script $handle
- 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)?
- Plugin Settings not Saving on Ajax re-ordered table
- How to post form in ajax mode and handle it in wordpress
- Using Ajax call in jQuery doesn’t work in widget
- Timeout on Admin-Ajax?
- 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
- Ensure function has completed before allowing another Ajax call
- How to create a Tools menu on the Network Admin dashboard from a plugin
- Show add_meta_box by selecting a specific category
- how do you prevent showing a particular category on the admin dashboard for specific user roles?
- include wp-blog-header not working on MAMP
- Slow WP_query due to nested wp_query. Need Suggestions
- .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?
- 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
- get post attachment using ajax
- “dashboard”-named PHP file doesn’t get included
- how to search users by ajax live search
- 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
- Including comments meta box on a plugin page
- Avoid updating post when sending POST or GET request to post.php
- wp_localize_script is not adding a global variable for javascript
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- Ajax is not working in a loop
- How to get error object returned by wp_create_user
- Meta box on options page save form problem
- Moving/dragging a metabox removes TinyMCE’s content
- Store custom meta box data as serialized array
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- ajax working when function is on child theme but not in plugin page
- AJAX call to admin-ajax.php by subscriber returns home page
- Ajax function is not working on WordPress
- About a programming language starts with [closed]
- Workflow for new importer plugin – your advices?
- AJAX request not routing through proxy
- Catch metabox values in Plugin
- want to show CMB2 metabox on woocommerce product data tab
- Ajax on the Administration Side of plugin – returns 0
- How to do admin ajax request in a plugin for rest api
- Ajax action has 200 status but response of No response data available for this request
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook
- How to show the posts listing on dashboard or custom page in admin panel?
- GET request return value as error instead of success
- Bad request 400 using class based files
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- ajax stopped working when not logged in wordpress
- Metabox types list
- ajax response strips multidimensional array and unable to decode
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- ajax-action.php can’t find added action
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- AJAX call of function containing javascript which is not loaded (Plugin development)
- add_meta_box does not display meta box in Admin
- $_SESSION inside php function executed by AJAX
- Two same AJAX calls – one is working, other doesn’t
- How to include files in the loop via ajax
- How to handle ajax Request in a complex-structured plugin?
- How to get values from Tinymce visual editor popup?
- PHP includes with AJAX actions
- WordPress function is not called and ajax return 0
- Ajax call not working with
- WP Ajax on page load not working on bluehost but was working on Godaddy
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- save_post not called in plugin / custom field still saving overwriting metaboxes
- Can’t get query string in ajax call
- Get fields of a widget
- Show Metabox Images in slideshow instead of static
- An adiitional function fires on my AJAX submit
- How to set/change another post author by custom fields or something else?
- Fatal error: Call to a member function query() on a non-object in my ajaxpage
- Page reload occurs before request finishes
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- WordPress plugin boilerplate AJAX functionality