Last active
May 16, 2024 22:00
-
-
Save gdnwebmedia/e7e1d20c6e1b200b1aed1366a55edf4f to your computer and use it in GitHub Desktop.
This code snippet replaces the default featured image meta box on a specific post type in the WordPress admin
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
/* | |
Please note: | |
The code uses __replace_with_post_type_slug__ which needs to be replaced with the actual post type slug where this functionality is desired. | |
Also replace ___replace_with_new_name___ with the new name you wish to use. | |
*/ | |
add_action( 'admin_head', 'replace_default_featured_image_meta_box', 100 ); | |
function replace_default_featured_image_meta_box() { | |
remove_meta_box( 'postimagediv', '__replace_with_post_type_slug__', 'side' ); | |
add_meta_box('postimagediv', __('___replace_with_new_name___'), 'post_thumbnail_meta_box', '__replace_with_post_type_slug__', 'side', 'high'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment