diff --git wp-admin/css/wp-admin.dev.css wp-admin/css/wp-admin.dev.css
index 3b9dca7..c675425 100644
--- wp-admin/css/wp-admin.dev.css
+++ wp-admin/css/wp-admin.dev.css
@@ -3724,7 +3724,8 @@ abbr.required {
}
.media-item .describe input[type="text"],
-.media-item .describe textarea {
+.media-item .describe textarea,
+.media-item .wp-editor-wrap {
width: 460px;
}
@@ -3906,10 +3907,6 @@ abbr.required {
border-radius: 3px;
}
-.media-item .post_excerpt textarea {
- height: 60px;
-}
-
/*------------------------------------------------------------------------------
14.1 - Media Library
------------------------------------------------------------------------------*/
diff --git wp-admin/includes/media.php wp-admin/includes/media.php
index a300769..5662dd6 100644
--- wp-admin/includes/media.php
+++ wp-admin/includes/media.php
@@ -791,25 +791,44 @@ function image_link_input_fields($post, $url_type = '') {
";
}
-function wp_caption_input_textarea($edit_post) {
+/**
+ * Render an editor for image caption
+ *
+ * @see `get_attachment_fields_to_edit()`
+ * @since 3.4
+ *
+ * @param Object $edit_post, media item object, default is false
+ * @param String $name, the name/id of the textarea if $edit_post is false, default is `caption`
+ * @param String $caption, value for caption if $edit_post is false, default is ``
+ * @return String, the generated html
+ */
+function wp_caption_input_textarea( $edit_post = false, $name = 'caption', $caption = '' ) {
// post data is already escaped
- $name = "attachments[{$edit_post->ID}][post_excerpt]";
+ if ( $edit_post ) {
+ $name = "attachments[{$edit_post->ID}][post_excerpt]";
+ $caption = $edit_post->post_excerpt;
+ }
- return '
-
-
- ';
+ $defaults = array(
+ 'teeny' => true,
+ 'tinymce' => false,
+ 'media_buttons' => false,
+ 'textarea_rows' => 10,
+ 'quicktags' => array(
+ 'buttons' => 'strong,em,link,del,ins,code,close'
+ )
+ );
+ $settings = apply_filters( 'caption_input_textarea', $defaults, $edit_post );
+
+ if ( defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST == true ) {
+ wp_enqueue_script( 'quicktags' );
+ wp_enqueue_script('wplink');
+ }
+
+ // Use a buffer to get the output, otherway it will just echo everything
+ ob_start();
+ wp_editor( $caption, $name, $settings );
+ return ob_get_clean();
}
/**
@@ -956,7 +975,7 @@ function get_attachment_fields_to_edit($post, $errors = null) {
'post_excerpt' => array(
'label' => __('Default Caption'),
'input' => 'html',
- 'html' => wp_caption_input_textarea($edit_post)
+ 'html' => wp_caption_input_textarea( $edit_post )
),
'post_content' => array(
'label' => __('Description'),
@@ -1954,9 +1973,8 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
|
- |
-
-';
+ ' . wp_caption_input_textarea() . ' |
+ ';
} else {
$caption = '';
}
diff --git wp-includes/class-wp-editor.php wp-includes/class-wp-editor.php
index af69b08..65878e4 100644
--- wp-includes/class-wp-editor.php
+++ wp-includes/class-wp-editor.php
@@ -554,7 +554,7 @@ final class _WP_Editors {
(function(){
var init, ed, qt, first_init, mce = ;
- if ( typeof(tinymce) == 'object' ) {
+ if ( typeof(tinymce) == 'object' && tinymce !== null ) {
// mark wp_theme/ui.css as loaded
tinymce.DOM.files[tinymce.baseURI.getURI() + '/themes/advanced/skins/wp_theme/ui.css'] = true;
diff --git wp-includes/js/tinymce/langs/wp-langs-en.js wp-includes/js/tinymce/langs/wp-langs-en.js
index 6921eab..53d784a 100644
--- wp-includes/js/tinymce/langs/wp-langs-en.js
+++ wp-includes/js/tinymce/langs/wp-langs-en.js
@@ -499,7 +499,5 @@ s120:"120%",
s130:"130%",
img_title:"Title",
caption:"Caption",
-insert_link:"Insert link",
-linked_text:"Linked text",
alt:"Alternate Text"
});
diff --git wp-includes/js/tinymce/langs/wp-langs.php wp-includes/js/tinymce/langs/wp-langs.php
index 625ef75..6100383 100644
--- wp-includes/js/tinymce/langs/wp-langs.php
+++ wp-includes/js/tinymce/langs/wp-langs.php
@@ -542,8 +542,6 @@ function wp_mce_translation() {
's130' => __('130%'),
'img_title' => __('Title'),
'caption' => __('Caption'),
- 'insert_link' => __('Insert link'),
- 'linked_text' => __('Linked text'),
'alt' => __('Alternate Text')
);
diff --git wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js
index 6e25a1f..2f680ea 100644
--- wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js
+++ wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js
@@ -8,7 +8,11 @@
open: function() {
var ed;
- // Initialize tinyMCEPopup if it exists and is the editor is active.
+ // Try to load tinyMCEPopup from parent window if we are inside an iframe
+ if ( typeof(tinyMCEPopup) === 'undefined' && window !== parent )
+ window.tinyMCEPopup = parent.tinyMCEPopup;
+
+ // Initialize tinyMCEPopup if it exists and if the editor is active.
if ( tinyMCEPopup && typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
tinyMCEPopup.init();
}
diff --git wp-includes/js/tinymce/plugins/wpeditimage/editimage.html wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
index 6437801..bddd108 100644
--- wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
+++ wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
@@ -7,6 +7,12 @@
+
+
@@ -101,21 +107,8 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
-
-
-
|
@@ -285,5 +278,17 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
+
+
+
+
+