I’m developing a WordPress plugin that presents a kind of dashboard, full of custom metaboxes. I was able to get the open/hide/close and drag handles working properly; however these screen customization are not saved: when I reload the page, everything goes to default config (actually, all metaboxes opened and sorted following the add_meta_box order in code).
I added this nonce code to my admin page, but nothing changes:
<form action="" method="">
<?php wp_nonce_field('dice-roller-metaboxes-settings'); ?>
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>
<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?>
<input type="hidden" name="action" value="save_dashboard_settings" />
</form>
Did I perhaps forgot something else?
you need to add some javascript to the bottom of the page that shows the metaboxes to handle the ajax save of the positions
be sure to change $hook in the add_postbox_toggles line to the correct value for the page you’re on