Skip to content

Instantly share code, notes, and snippets.

@kovshenin
Created August 17, 2012 07:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kovshenin/3376828 to your computer and use it in GitHub Desktop.
Save kovshenin/3376828 to your computer and use it in GitHub Desktop.
Featured Image Size in Metabox
<?php
/**
* Plugin Name: Featured Image Size in Metabox
* Description: Adds 123x456 to the metabox title in featured image.
*/
add_action( 'do_meta_boxes', 'my_do_meta_boxes' );
function my_do_meta_boxes( $post_type ) {
global $wp_meta_boxes;
if ( ! current_theme_supports( 'post-thumbnails', $post_type ) || ! post_type_supports( $post_type, 'thumbnail' ) )
return;
print_r($wp_meta_boxes);
foreach ( $wp_meta_boxes[ $post_type ] as $context => $priorities )
foreach ( $priorities as $priority => $meta_boxes )
foreach ( $meta_boxes as $id => $box )
if ( 'postimagediv' == $id )
$wp_meta_boxes[ $post_type ][ $context ][ $priority ][ $id ]['title'] .= ' 123x456';
remove_action( 'do_meta_boxes', 'my_do_meta_boxes' );
}
@kcdipesh
Copy link

very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment