mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Display Post/Page Thumbnail meta box even if theme does not support it -- just display an info message. props janeforshort
git-svn-id: https://develop.svn.wordpress.org/trunk@12322 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1068,6 +1068,17 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
* @return string html
|
||||
*/
|
||||
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
|
||||
global $post;
|
||||
if ( !current_theme_supports( 'post-thumbnails' ) ) {
|
||||
if ( 'post' == $post->post_type ) {
|
||||
$type = __( 'post' );
|
||||
} elseif ( 'page' == $post->post_type ) {
|
||||
$type = __( 'page' );
|
||||
} else {
|
||||
$type = $post->post_type;
|
||||
}
|
||||
return sprintf( __( '<p>Your theme does not currently support <a href="%1$s">%2$s thumbnails</a>.</p><p>You can hide this module by clicking the "Screen Options" tab.</p>' ), _x( 'http://codex.wordpress.org/Post_Images', 'Within the post/page thumbnail module on the post/page edit screen' ), $type );
|
||||
}
|
||||
$content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>';
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
|
||||
Reference in New Issue
Block a user