Last active
January 2, 2016 11:09
-
-
Save simongcc/8294482 to your computer and use it in GitHub Desktop.
Disable metabox dragging order save to DB in Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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