Created
February 8, 2017 11:08
-
-
Save joshuacharleslake/2d90febcffa52d7fd3aa4d4394c882bf to your computer and use it in GitHub Desktop.
Show message next to featured image in backend of WP - add to functions.php
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
// | |
// Add Comment Next To Featured Image on Post Types | |
// | |
function add_featured_image_display_settings( $content, $post_id ) { | |
global $post; | |
if ($post->post_type != 'post') { | |
$field_id = 'show_featured_image'; | |
$field_value = esc_attr( get_post_meta( $post_id, $field_id, true ) ); | |
$field_text = esc_html__( 'Recommended Size = 400px x 400px', 'generatewp' ); | |
return $content .= $field_text; | |
} else { | |
$field_id = 'show_featured_image'; | |
$field_value = esc_attr( get_post_meta( $post_id, $field_id, true ) ); | |
return $content .= ""; | |
} | |
} | |
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_display_settings', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment