WordPress.org

Make WordPress Core

Changeset 14118


Ignore:
Timestamp:
04/16/2010 09:45:16 PM (12 years ago)
Author:
nacin
Message:

More tweaks for thumbnail support when no editor support for custom post types. see #12792, props scribu.

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r14059 r14118  
    11621162        $thumb_url = false;
    11631163
    1164     $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
     1164    $default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($_GET['post_id']), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true );
    11651165    $args = wp_parse_args( $args, $default_args );
    11661166    extract( $args, EXTR_SKIP );
     
    19931993 */
    19941994function type_url_form_image() {
    1995 
    19961995    if ( !apply_filters( 'disable_captions', '' ) ) {
    19971996        $caption = '
     
    20622061            <p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td>
    20632062        </tr>
    2064 
    2065         <tr>
    2066             <td></td>
    2067             <td>
    2068                 <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" />
    2069             </td>
    2070         </tr>
     2063    ' . _insert_into_post_button('image') . '
    20712064    </tbody></table>
    20722065';
     
    20992092        </tr>
    21002093        <tr><td></td><td class="help">' . __('Link text, e.g. &#8220;Still Alive by Jonathan Coulton&#8221;') . '</td></tr>
    2101         <tr>
    2102             <td></td>
    2103             <td>
    2104                 <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
    2105             </td>
    2106         </tr>
     2094    ' . _insert_into_post_button('audio') . '
    21072095    </tbody></table>
    21082096';
     
    21342122        </tr>
    21352123        <tr><td></td><td class="help">' . __('Link text, e.g. &#8220;Lucy on YouTube&#8220;') . '</td></tr>
    2136         <tr>
    2137             <td></td>
    2138             <td>
    2139                 <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
    2140             </td>
    2141         </tr>
     2124    ' . _insert_into_post_button('video') . '
    21422125    </tbody></table>
    21432126';
     
    21692152        </tr>
    21702153        <tr><td></td><td class="help">' . __('Link text, e.g. &#8220;Ransom Demands (PDF)&#8221;') . '</td></tr>
     2154    ' . _insert_into_post_button('file') . '
     2155    </tbody></table>
     2156';
     2157}
     2158
     2159
     2160function _insert_into_post_button($type) {
     2161    if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') )
     2162        return '';
     2163   
     2164    if ( 'image' == $type )
     2165    return '
     2166        <tr>
     2167            <td></td>
     2168            <td>
     2169                <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" />
     2170            </td>
     2171        </tr>       
     2172    ';
     2173
     2174    return '
    21712175        <tr>
    21722176            <td></td>
     
    21752179            </td>
    21762180        </tr>
    2177     </tbody></table>
    2178 ';
     2181    ';
    21792182}
    21802183
  • trunk/wp-admin/includes/post.php

    r14015 r14118  
    11451145    global $content_width, $_wp_additional_image_sizes;
    11461146
    1147     $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>';
     1147    $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>';
    11481148    $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
    11491149
Note: See TracChangeset for help on using the changeset viewer.