Skip to content

Instantly share code, notes, and snippets.

@blainerobison
Created October 8, 2015 17:57
Show Gist options
  • Save blainerobison/3be099994788270dc4db to your computer and use it in GitHub Desktop.
Save blainerobison/3be099994788270dc4db to your computer and use it in GitHub Desktop.
Add Featured Image Description in WordPress
<?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