WordPress Snippet
Last active
February 28, 2018 18:01
-
-
Save ControlledChaos/7eea26988f221b0d9ecdb510fde66d86 to your computer and use it in GitHub Desktop.
Resets the metabox layout on post edit screens. Comes in handy when Advanced Custom Fields position, such as "high, after title", is being ignored.
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
<?php | |
function ccd_reset_metabox_layout(){ | |
delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_post' ); | |
delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_page' ); | |
delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_custom_post_type' ); | |
} | |
add_action( 'admin_init', 'ccd_reset_metabox_layout' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment