Last active
May 8, 2016 17:20
-
-
Save kronda/b23e1ed0f4dea86dda25da89e189bb59 to your computer and use it in GitHub Desktop.
Featured Image Size Hints where all featured images are the same size. From https://premium.wpmudev.org/blog/never-forget-your-featured-image-dimensions/
This file contains hidden or 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
/* Featured Image Size Hints */ | |
add_action( 'do_meta_boxes', 'karveldigital_do_meta_boxes' ); | |
function efs_do_meta_boxes( $post_type ) { | |
global $wp_meta_boxes; | |
if ( ! current_theme_supports( 'post-thumbnails', $post_type ) || ! post_type_supports( $post_type, 'thumbnail' ) ) | |
return; | |
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'] .= ' 215w x 139h'; | |
remove_action( 'do_meta_boxes', 'karveldigital_do_meta_boxes' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment