Skip to content

Instantly share code, notes, and snippets.

@aaronsummers
Forked from electricbrick/reset-acf-metabox.php
Last active March 19, 2021 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronsummers/2bc81ff2fc27134aa0f73c710a27c5c0 to your computer and use it in GitHub Desktop.
Save aaronsummers/2bc81ff2fc27134aa0f73c710a27c5c0 to your computer and use it in GitHub Desktop.
Reset ACF Metabox Positions
<?php
$user_id = 1;
$custom_post_type = 'my_post_type';
function prefix_reset_metabox_positions(){
delete_user_meta( $user_id, 'meta-box-order_post' ); // Posts
delete_user_meta( $user_id, 'meta-box-order_page' ); // Pages
delete_user_meta( $user_id, 'meta-box-order_' . $custom_post_type ); // Custom post types
}
add_action( 'admin_init', 'prefix_reset_metabox_positions' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment