Created
October 8, 2015 17:57
-
-
Save blainerobison/3be099994788270dc4db to your computer and use it in GitHub Desktop.
Add Featured Image Description in WordPress
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
<?php | |
/** | |
* Add Featured Image Description | |
* | |
* @param string $content Admin post thumbnail HTML markup. | |
* @param integer $content Post ID. | |
* @return string | |
*/ | |
function prefix_featured_image_description( $content, $post_id ) { | |
if ( 'post' === get_post_type( $post_id ) ) : | |
$content .= '<p>Displayed within the main content area of post. <br> <strong>Image Dimensions: 655 x 385px</strong></p>'; | |
else : | |
$content .= '<p><strong>Image Dimensions: 655 x 385px</strong></p>'; | |
endif; | |
return $content; | |
} | |
add_filter( 'admin_post_thumbnail_html', 'prefix_featured_image_description'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment