Skip to content

Instantly share code, notes, and snippets.

@simongcc
Last active January 2, 2016 11:09
Show Gist options
  • Save simongcc/8294482 to your computer and use it in GitHub Desktop.
Save simongcc/8294482 to your computer and use it in GitHub Desktop.
Disable metabox dragging order save to DB in Wordpress
/*
Purpose: Disable metabox dragging order save to DB
Version Tested: 3.8
Original Reference:
1 http://wordpress.stackexchange.com/questions/2025/removing-metabox-for-slug-without-removing-functionality
2 http://wordpress.stackexchange.com/questions/2474/disable-dragging-of-meta-boxes
3 http://stackoverflow.com/questions/3399851/how-do-i-stop-wordpress-dashboard-widgets-from-being-dragged/3477209#3477209
*/
function wp_prevent_meta_box_order_save($action)
{
if ('meta-box-order' == $action /* && $wp_user == 'santa claus' */) {
die('-1');
}
}
add_action('check_ajax_referer', 'wp_prevent_meta_box_order_save');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment