WordPress.org

Make WordPress Core

Changeset 8358


Ignore:
Timestamp:
07/16/08 21:36:17 (6 years ago)
Author:
azaozz
Message:

Removes the disabling of captions, but leaves couple of hooks so a plugin can do it easily. see #6812

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/gears-manifest.php

    r8313 r8358  
    6565{ 
    6666"betaManifestVersion" : 1, 
    67 "version" : "<?php echo $man_version; ?>_20080710a", 
     67"version" : "<?php echo $man_version; ?>_20080712", 
    6868"entries" : [ 
    6969<?php echo $defaults; ?> 
     
    132132{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, 
    133133{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, 
    134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311d" }, 
     134{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311e" }, 
    135135{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, 
    136136{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, 
     
    149149{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 
    150150{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 
    151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311d" }, 
     151{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311e" }, 
    152152{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 
    153153 
     
    162162{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 
    163163{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 
    164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311d" }, 
     164{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311e" }, 
    165165{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 
    166166{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, 
  • trunk/wp-admin/includes/media.php

    r8321 r8358  
    6868function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 
    6969 
    70     // CAPTIONS_OFF is temporary. Do not use it. 
    71     if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; 
     70    if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; 
    7271    $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 
    7372 
     
    511510        $form_fields['post_title']['required'] = true; 
    512511 
    513         // CAPTIONS_OFF is temporary. Do not use it. 
    514         if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 
    515             $form_fields['post_excerpt']['label'] = __('Alternate Text'); 
    516             $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); 
    517         } else { 
    518             $form_fields['post_excerpt']['label'] = __('Caption'); 
    519             $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 
    520         } 
     512        $form_fields['post_excerpt']['label'] = __('Caption'); 
     513        $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 
    521514 
    522515        $form_fields['post_content']['label'] = __('Description'); 
     
    607600    $link = get_attachment_link($post->ID); 
    608601 
    609     // CAPTIONS_OFF is temporary. Do not use it. 
    610     if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 
    611         $alt = __('Alternate Text'); 
    612     else 
    613         $alt = __('Caption'); 
    614  
    615602    $form_fields = array( 
    616603        'post_title'   => array( 
     
    619606        ), 
    620607        'post_excerpt' => array( 
    621             'label'      => $alt, 
     608            'label'      => __('Caption'), 
    622609            'value'      => $edit_post->post_excerpt, 
    623610        ), 
     
    10221009        if ( f.alt.value ) { 
    10231010            alt = f.alt.value.replace(/['"<>]+/g, ''); 
    1024 <?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it. ?> 
     1011<?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?> 
    10251012            caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); 
    10261013<?php } ?> 
     
    12791266 
    12801267function type_form_image() { 
    1281     $form = ' 
     1268 
     1269    if ( apply_filters( 'disable_captions', '' ) ) { 
     1270        $alt = __('Alternate Text'); 
     1271        $alt_help = __('Alt text for the image, e.g. "The Mona Lisa"'); 
     1272    } else { 
     1273        $alt = __('Image Caption'); 
     1274        $alt_help = __('Also used as alternate text for the image'); 
     1275    } 
     1276     
     1277    return ' 
    12821278    <table class="describe"><tbody> 
    12831279        <tr> 
     
    12961292            <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 
    12971293        </tr> 
    1298 '; 
    1299     // CAPTIONS_OFF is temporary. Do not use it. 
    1300     if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 
    1301         $form .= ' 
     1294 
    13021295        <tr> 
    13031296            <th valign="top" scope="row" class="label"> 
    1304                 <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span> 
     1297                <span class="alignleft"><label for="alt">' . $alt . '</label></span> 
    13051298            </th> 
    13061299            <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 
    1307             <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td> 
    1308         </tr> 
    1309 '; 
    1310  
    1311     } else { 
    1312         $form .= ' 
    1313         <tr> 
    1314             <th valign="top" scope="row" class="label"> 
    1315                 <span class="alignleft"><label for="alt">' . __('Image Caption') . '</label></span> 
    1316             </th> 
    1317             <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 
    1318             <p class="help">' . __('Also used as alternate text for the image') . '</p></td> 
    1319         </tr> 
    1320 '; 
    1321     } 
    1322         $form .= ' 
     1300            <p class="help">' . $alt_help . '</p></td> 
     1301        </tr> 
     1302 
    13231303        <tr class="align"> 
    13241304            <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> 
     
    13551335'; 
    13561336 
    1357     return $form; 
    13581337} 
    13591338 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html

    r8313 r8358  
    55<title></title> 
    66 
    7 <script type="text/javascript" src="js/editimage.js?ver=311d"></script> 
     7<script type="text/javascript" src="js/editimage.js?ver=311e"></script> 
    88<script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> 
    99 
    10 <link rel="stylesheet" href="css/editimage.css?ver=311d" type="text/css" media="all" /> 
    11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" /> 
     10<link rel="stylesheet" href="css/editimage.css?ver=311e" type="text/css" media="all" /> 
     11<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6" type="text/css" media="all" /> 
    1212<script type="text/javascript"> 
    1313if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js

    r8313 r8358  
    1616                    return; 
    1717 
    18                 tb_show('', url + '/editimage.html?ver=311c&TB_iframe=true'); 
     18                tb_show('', url + '/editimage.html?ver=311e&TB_iframe=true'); 
    1919                tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 
    2020            }); 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js

    r8356 r8358  
    249249        document.dir = tinyMCEPopup.editor.getParam('directionality',''); 
    250250 
    251         if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) ) 
     251        if ( tinyMCEPopup.editor.getParam('wpeditimage_disable_captions', false) ) 
    252252            t.I('cap_field').style.display = 'none'; 
    253253 
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r8313 r8358  
    131131$mce_buttons_4 = implode($mce_buttons_4, ','); 
    132132 
    133 $do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true; 
     133$no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false; 
    134134 
    135135// TinyMCE init settings 
     
    166166    'content_css' => "$mce_css", 
    167167    'save_callback' => 'switchEditors.saveCallback', 
    168     'wpeditimage_do_captions' => $do_captions, 
     168    'wpeditimage_disable_captions' => $no_captions, 
    169169    'plugins' => "$plugins", 
    170170    // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 
     
    226226if ( $disk_cache ) { 
    227227 
    228     $cacheKey = apply_filters('tiny_mce_version', '20080710'); 
     228    $cacheKey = apply_filters('tiny_mce_version', '20080712'); 
    229229 
    230230    foreach ( $initArray as $v ) 
  • trunk/wp-includes/media.php

    r8313 r8358  
    355355 
    356356function img_caption_shortcode($attr, $content = null) { 
    357  
    358     if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 
    359         return $content; 
    360357 
    361358    // Allow plugins/themes to override the default caption template. 
  • trunk/wp-includes/script-loader.php

    r8347 r8358  
    3838 
    3939    // Modify this version when tinyMCE plugins are changed. 
    40     $mce_version = apply_filters('tiny_mce_version', '20080710'); 
     40    $mce_version = apply_filters('tiny_mce_version', '20080712'); 
    4141    $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 
    4242 
Note: See TracChangeset for help on using the changeset viewer.