Constrain admin thumbnail display to width of meta box while in sidebar. Add filters.
git-svn-id: https://develop.svn.wordpress.org/trunk@12018 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cfad60032c
commit
a3bf844ed3
@ -116,11 +116,11 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
|
|||||||
|
|
||||||
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
|
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
|
||||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||||
$thumbnail_html = wp_get_attachment_image($thumbnail_id, 'thumbnail');
|
$thumbnail_html = wp_get_attachment_image($thumbnail_id, array( 266, 266 ) );
|
||||||
if ( !empty( $thumbnail_html ) )
|
if ( !empty( $thumbnail_html ) )
|
||||||
return '<a href="#" id="cws-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';
|
return apply_filters( 'admin_post_thumbnail_html', '<a href="#" id="cws-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>' );
|
||||||
}
|
}
|
||||||
return '<a href="#" id="cws-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a>';
|
return apply_filters( 'admin_post_thumbnail_html', '<a href="#" id="cws-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a>' );
|
||||||
}
|
}
|
||||||
|
|
||||||
function post_thumbnail_meta_box() {
|
function post_thumbnail_meta_box() {
|
||||||
|
Loading…
Reference in New Issue
Block a user