Featured Image Label

Replace Featured Image Label from metabox in pages/posts admin side
PLACE CODE IN FUNCTIONS.PHP

add_action('do_meta_boxes', 'replace_featured_image_box');
function replace_featured_image_box(){
	$page_title = get_the_title($post_id); //provide current post id
	if(empty($page_title)){
		$page_title = 'Page';
	}
	$page_title .= ' Image';

    remove_meta_box( 'postimagediv', 'page', 'side' );  
    //removes old metabox from page
    
    add_meta_box('postimagediv', __($page_title), 'post_thumbnail_meta_box', 'page', 'side', 'low');
    //adds new metabox with updated label on pages
    
    remove_meta_box( 'postimagediv', 'post', 'side' );
    //removes old metabox from post
    
    add_meta_box('postimagediv', __($page_title), 'post_thumbnail_meta_box', 'post', 'side', 'low');
    //adds new metabox with updated label on posts
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s