Created
August 17, 2012 07:53
-
-
Save kovshenin/3376828 to your computer and use it in GitHub Desktop.
Featured Image Size in Metabox
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 | |
/** | |
* 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' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very helpful!