Permalink
Browse files

Removes the disabling of captions, but leaves couple of hooks so a pl…

…ugin can do it easily. For 2.6.1, see #6812

git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent b08fd81 commit 56677ba0688caa601626018eb6463b26d65faffb azaozz committed Aug 10, 2008
@@ -64,7 +64,7 @@ function wp_guess_url() {}
?>
{
"betaManifestVersion" : 1,
-"version" : "<?php echo $man_version; ?>_20080731",
+"version" : "<?php echo $man_version; ?>_20080810",
"entries" : [
<?php echo $defaults; ?>
@@ -131,7 +131,7 @@ function wp_guess_url() {}
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" },
-{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311f" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" },
@@ -148,7 +148,7 @@ function wp_guess_url() {}
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" },
-{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311f" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" },
@@ -161,7 +161,7 @@ function wp_guess_url() {}
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" },
-{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311f" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" },
@@ -67,8 +67,7 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
- // CAPTIONS_OFF is temporary. Do not use it.
- if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html;
+ if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html;
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
preg_match( '/width="([0-9]+)/', $html, $matches );
@@ -510,14 +509,8 @@ function image_attachment_fields_to_edit($form_fields, $post) {
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
$form_fields['post_title']['required'] = true;
- // CAPTIONS_OFF is temporary. Do not use it.
- if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {
- $form_fields['post_excerpt']['label'] = __('Alternate Text');
- $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"');
- } else {
- $form_fields['post_excerpt']['label'] = __('Caption');
- $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
- }
+ $form_fields['post_excerpt']['label'] = __('Caption');
+ $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
$form_fields['post_content']['label'] = __('Description');
@@ -606,19 +599,13 @@ function get_attachment_fields_to_edit($post, $errors = null) {
$file = wp_get_attachment_url($post->ID);
$link = get_attachment_link($post->ID);
- // CAPTIONS_OFF is temporary. Do not use it.
- if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )
- $alt = __('Alternate Text');
- else
- $alt = __('Caption');
-
$form_fields = array(
'post_title' => array(
'label' => __('Title'),
'value' => $edit_post->post_title,
),
'post_excerpt' => array(
- 'label' => $alt,
+ 'label' => __('Caption'),
'value' => $edit_post->post_excerpt,
),
'post_content' => array(
@@ -1019,7 +1006,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
if ( f.alt.value ) {
alt = f.alt.value.replace(/['"<>]+/g, '');
-<?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it. ?>
+<?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
<?php } ?>
}
@@ -1277,7 +1264,16 @@ function media_upload_library_form($errors) {
}
function type_form_image() {
- $form = '
+
+ if ( apply_filters( 'disable_captions', '' ) ) {
+ $alt = __('Alternate Text');
+ $alt_help = __('Alt text for the image, e.g. "The Mona Lisa"');
+ } else {
+ $alt = __('Image Caption');
+ $alt_help = __('Also used as alternate text for the image');
+ }
+
+ return '
<table class="describe"><tbody>
<tr>
<th valign="top" scope="row" class="label" style="width:120px;">
@@ -1294,31 +1290,15 @@ function type_form_image() {
</th>
<td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
</tr>
-';
- // CAPTIONS_OFF is temporary. Do not use it.
- if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {
- $form .= '
- <tr>
- <th valign="top" scope="row" class="label">
- <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span>
- </th>
- <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
- <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td>
- </tr>
-';
- } else {
- $form .= '
<tr>
<th valign="top" scope="row" class="label">
- <span class="alignleft"><label for="alt">' . __('Image Caption') . '</label></span>
+ <span class="alignleft"><label for="alt">' . $alt . '</label></span>
</th>
<td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
- <p class="help">' . __('Also used as alternate text for the image') . '</p></td>
+ <p class="help">' . $alt_help . '</p></td>
</tr>
-';
- }
- $form .= '
+
<tr class="align">
<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
<td class="field">
@@ -1353,7 +1333,6 @@ function type_form_image() {
</tbody></table>
';
- return $form;
}
function type_form_audio() {
@@ -4,11 +4,11 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
-<script type="text/javascript" src="js/editimage.js?ver=311f"></script>
+<script type="text/javascript" src="js/editimage.js?ver=311g"></script>
<script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
-<link rel="stylesheet" href="css/editimage.css?ver=311f" type="text/css" media="all" />
-<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6" type="text/css" media="all" />
+<link rel="stylesheet" href="css/editimage.css?ver=311g" type="text/css" media="all" />
+<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6.1" type="text/css" media="all" />
<script type="text/javascript">
if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
document.write('<link rel="stylesheet" href="css/editimage-rtl.css?ver=311" type="text/css" media="all" />');
@@ -15,7 +15,7 @@
if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
return;
- tb_show('', url + '/editimage.html?ver=311f&TB_iframe=true');
+ tb_show('', url + '/editimage.html?ver=311g&TB_iframe=true');
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
});
@@ -248,7 +248,7 @@ var wpImage = {
var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption = '';
document.dir = tinyMCEPopup.editor.getParam('directionality','');
- if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) )
+ if ( tinyMCEPopup.editor.getParam('wpeditimage_disable_captions', false) )
t.I('cap_field').style.display = 'none';
tinyMCEPopup.restoreSelection();
@@ -130,7 +130,7 @@ function putFileContents( $path, $content ) {
$mce_buttons_4 = apply_filters('mce_buttons_4', array());
$mce_buttons_4 = implode($mce_buttons_4, ',');
-$do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true;
+$no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false;
// TinyMCE init settings
$initArray = array (
@@ -165,7 +165,7 @@ function putFileContents( $path, $content ) {
'tab_focus' => ':next',
'content_css' => "$mce_css",
'save_callback' => 'switchEditors.saveCallback',
- 'wpeditimage_do_captions' => $do_captions,
+ 'wpeditimage_disable_captions' => $no_captions,
'plugins' => "$plugins",
// pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init"
'disk_cache' => true,
@@ -225,7 +225,7 @@ function putFileContents( $path, $content ) {
// Setup cache info
if ( $disk_cache ) {
- $cacheKey = apply_filters('tiny_mce_version', '20080731');
+ $cacheKey = apply_filters('tiny_mce_version', '20080810');
foreach ( $initArray as $v )
$cacheKey .= $v;
View
@@ -355,9 +355,6 @@ function wp_get_attachment_image($attachment_id, $size='thumbnail', $icon = fals
function img_caption_shortcode($attr, $content = null) {
- if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )
- return $content;
-
// Allow plugins/themes to override the default caption template.
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
if ( $output != '' )
@@ -37,7 +37,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080710' );
// Modify this version when tinyMCE plugins are changed.
- $mce_version = apply_filters('tiny_mce_version', '20080710');
+ $mce_version = apply_filters('tiny_mce_version', '20080810');
$scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');

0 comments on commit 56677ba

Please sign in to comment.