mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
More tweaks for thumbnail support when no editor support for custom post types. see #12792, props scribu.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e6e03bd7df
commit
9b76fb2563
@ -1161,7 +1161,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
else
|
||||
$thumb_url = false;
|
||||
|
||||
$default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
|
||||
$default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($_GET['post_id']), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true );
|
||||
$args = wp_parse_args( $args, $default_args );
|
||||
extract( $args, EXTR_SKIP );
|
||||
|
||||
@ -1992,7 +1992,6 @@ jQuery(function($){
|
||||
* @return unknown
|
||||
*/
|
||||
function type_url_form_image() {
|
||||
|
||||
if ( !apply_filters( 'disable_captions', '' ) ) {
|
||||
$caption = '
|
||||
<tr>
|
||||
@ -2061,13 +2060,7 @@ function type_url_form_image() {
|
||||
<button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __('Link to image') . '</button>
|
||||
<p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" />
|
||||
</td>
|
||||
</tr>
|
||||
' . _insert_into_post_button('image') . '
|
||||
</tbody></table>
|
||||
';
|
||||
|
||||
@ -2098,12 +2091,7 @@ function type_url_form_audio() {
|
||||
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
|
||||
</tr>
|
||||
<tr><td></td><td class="help">' . __('Link text, e.g. “Still Alive by Jonathan Coulton”') . '</td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
|
||||
</td>
|
||||
</tr>
|
||||
' . _insert_into_post_button('audio') . '
|
||||
</tbody></table>
|
||||
';
|
||||
}
|
||||
@ -2133,12 +2121,7 @@ function type_url_form_video() {
|
||||
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
|
||||
</tr>
|
||||
<tr><td></td><td class="help">' . __('Link text, e.g. “Lucy on YouTube“') . '</td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
|
||||
</td>
|
||||
</tr>
|
||||
' . _insert_into_post_button('video') . '
|
||||
</tbody></table>
|
||||
';
|
||||
}
|
||||
@ -2168,14 +2151,34 @@ function type_url_form_file() {
|
||||
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
|
||||
</tr>
|
||||
<tr><td></td><td class="help">' . __('Link text, e.g. “Ransom Demands (PDF)”') . '</td></tr>
|
||||
' . _insert_into_post_button('file') . '
|
||||
</tbody></table>
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
function _insert_into_post_button($type) {
|
||||
if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') )
|
||||
return '';
|
||||
|
||||
if ( 'image' == $type )
|
||||
return '
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" />
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
return '
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
';
|
||||
';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1144,7 +1144,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
|
||||
global $content_width, $_wp_additional_image_sizes;
|
||||
|
||||
$set_thumbnail_link = '<p class="hide-if-no-js"><a href="' . get_upload_iframe_src('image') . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
|
||||
$set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . get_upload_iframe_src('image') . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
|
||||
$content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user