<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[22541] trunk: Media: Add backwards compatibility for attachment_fields_to_edit and attachment_fields_to_save.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/22541">22541</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-11-11 01:26:42 +0000 (Sun, 11 Nov 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Media: Add backwards compatibility for attachment_fields_to_edit and attachment_fields_to_save. see <a href="http://core.trac.wordpress.org/ticket/22186">#22186</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpincludescssmediaviewscss">trunk/wp-includes/css/media-views.css</a></li>
<li><a href="#trunkwpincludesjsmediamodelsjs">trunk/wp-includes/js/media-models.js</a></li>
<li><a href="#trunkwpincludesjsmediaviewsjs">trunk/wp-includes/js/media-views.js</a></li>
<li><a href="#trunkwpincludesmediaphp">trunk/wp-includes/media.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-admin/admin-ajax.php        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
</span><span class="cx">         'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
</span><span class="cx">         'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
</span><del>-        'query-attachments', 'save-attachment',
</del><ins>+        'query-attachments', 'save-attachment', 'save-attachment-compat',
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> // Register core Ajax calls.
</span></span></pre></div>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-admin/includes/ajax-actions.php        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -1850,19 +1850,72 @@
</span><span class="cx">                 wp_send_json_error();
</span><span class="cx">
</span><span class="cx">         $changes = $_REQUEST['changes'];
</span><del>-        $args = array();
</del><ins>+        $post = get_post( $id, ARRAY_A );
</ins><span class="cx">
</span><del>-        if ( ! empty( $changes['title'] ) )
-                $args['post_title'] = $changes['title'];
</del><ins>+        if ( 'attachment' != $post['post_type'] )
+                wp_send_json_error();
</ins><span class="cx">
</span><del>-        if ( ! empty( $changes['caption'] ) )
-                $args['post_excerpt'] = $changes['caption'];
</del><ins>+        if ( isset( $changes['title'] ) )
+                $post['post_title'] = $changes['title'];
</ins><span class="cx">
</span><del>-        if ( ! empty( $changes['alt'] ) )
-                $args['_wp_attachment_image_alt'] = $changes['alt'];
</del><ins>+        if ( isset( $changes['caption'] ) )
+                $post['post_excerpt'] = $changes['caption'];
</ins><span class="cx">
</span><del>-        if ( $args )
-                edit_post( array_merge( $args, array( 'post_ID' => $id ) ) );
</del><ins>+        if ( isset( $changes['alt'] ) ) {
+                $alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );
+                $new_alt = stripslashes( $changes['alt'] );
+                if ( $alt != $new_alt ) {
+                        $new_alt = wp_strip_all_tags( $new_alt, true );
+                        update_post_meta( $id, '_wp_attachment_image_alt', addslashes( $new_alt ) );
+                }
+        }
</ins><span class="cx">
</span><ins>+        wp_update_post( $post );
</ins><span class="cx">         wp_send_json_success();
</span><span class="cx"> }
</span><ins>+
+/**
+ * Save backwards compatible attachment attributes.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_save_attachment_compat() {
+        if ( ! isset( $_REQUEST['id'] ) )
+                wp_send_json_error();
+
+        if ( ! $id = absint( $_REQUEST['id'] ) )
+                wp_send_json_error();
+
+        if ( empty( $_REQUEST['attachments'] ) || empty( $_REQUEST['attachments'][ $id ] ) )
+                wp_send_json_error();
+        $attachment_data = $_REQUEST['attachments'][ $id ];
+
+        check_ajax_referer( 'save-attachment', 'nonce' );
+
+        if ( ! current_user_can( 'edit_post', $id ) )
+                wp_send_json_error();
+
+        $post = get_post( $id, ARRAY_A );
+
+        if ( 'attachment' != $post['post_type'] )
+                wp_send_json_error();
+
+        $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
+
+        if ( isset( $post['errors'] ) ) {
+                $errors = $post['errors']; // @todo return me and display me!
+                unset( $post['errors'] );
+        }
+
+        wp_update_post( $post );
+
+        foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
+                if ( isset( $attachment_data[ $taxonomy ] ) )
+                        wp_set_object_terms( $id, array_map( 'trim', preg_split( '/,+/', $attachment_data[ $taxonomy ] ) ), $taxonomy, false );
+        }
+
+        if ( ! $attachment = wp_prepare_attachment_for_js( $id ) )
+                wp_send_json_error();
+
+        wp_send_json_success( $attachment );
+}
</ins></span></pre></div>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-admin/includes/media.php        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -1269,6 +1269,106 @@
</span><span class="cx">         return $item;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function get_compat_media_markup( $attachment_id, $args = null ) {
+        $post = get_post( $attachment_id );
+
+        $default_args = array(
+                'errors' => null,
+        );
+
+        $args = wp_parse_args( $args, $default_args );
+        $args = apply_filters( 'get_media_item_args', $args );
+
+        $errors = $args['errors'];
+
+        $form_fields = get_attachment_fields_to_edit( $post, $errors );
+
+        $media_meta = apply_filters( 'media_meta', '', $post );
+
+        $defaults = array(
+                'input' => 'text',
+                'required' => false,
+                'value' => '',
+                'extra_rows' => array(),
+        );
+
+        $hidden_fields = array();
+
+        unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'],
+                $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'],
+                $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] );
+
+        $item = '';
+        foreach ( $form_fields as $id => $field ) {
+                if ( $id[0] == '_' )
+                        continue;
+
+                $name = "attachments[$attachment_id][$id]";
+
+                if ( !empty( $field['tr'] ) ) {
+                        $item .= $field['tr'];
+                        continue;
+                }
+
+                $field = array_merge( $defaults, $field );
+
+                if ( $field['input'] == 'hidden' ) {
+                        $hidden_fields[$id] = $field['value'];
+                        continue;
+                }
+
+                $required = $field['required'] ? '<span class="alignright"><abbr title="required" class="required">*</abbr></span>' : '';
+                $aria_required = $field['required'] ? " aria-required='true' " : '';
+                $class = 'compat-item-' . $name;
+                $class .= $field['required'] ? ' form-required' : '';
+
+                $item .= "\t\t<tr class='$class'>";
+                $item .= "\t\t\t<th valign='top' scope='row' class='label'><label for='$name'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>";
+                $item .= "</th>\n\t\t\t<td class='field'>";
+
+                if ( !empty( $field[ $field['input'] ] ) )
+                        $item .= $field[ $field['input'] ];
+                elseif ( $field['input'] == 'textarea' ) {
+                        if ( 'post_content' == $id && user_can_richedit() ) {
+                                // sanitize_post() skips the post_content when user_can_richedit
+                                $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );
+                        }
+                        $item .= "<textarea id='$name' name='$name' $aria_required>" . $field['value'] . '</textarea>';
+                } else {
+                        $item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "' $aria_required />";
+                }
+                if ( !empty( $field['helps'] ) )
+                        $item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
+                $item .= "</td>\n\t\t</tr>\n";
+
+                $extra_rows = array();
+
+                if ( !empty( $field['errors'] ) )
+                        foreach ( array_unique( (array) $field['errors'] ) as $error )
+                                $extra_rows['error'][] = $error;
+
+                if ( !empty( $field['extra_rows'] ) )
+                        foreach ( $field['extra_rows'] as $class => $rows )
+                                foreach ( (array) $rows as $html )
+                                        $extra_rows[$class][] = $html;
+
+                foreach ( $extra_rows as $class => $rows )
+                        foreach ( $rows as $html )
+                                $item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n";
+        }
+
+        if ( !empty( $form_fields['_final'] ) )
+                $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
+        if ( $item )
+                $item = '<table>' . $item . '</table>';
+
+        return array(
+                'item' => $item,
+                'hidden' => $hidden_fields,
+                'meta' => $media_meta,
+        );
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * {@internal Missing Short Description}}
</span><span class="cx"> *
</span></span></pre></div>
<a id="trunkwpincludescssmediaviewscss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/css/media-views.css (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/media-views.css        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-includes/css/media-views.css        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -200,37 +200,98 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .media-sidebar .setting span {
</span><del>-        float: left;
</del><span class="cx">         min-width: 30%;
</span><del>-        min-height: 24px;
</del><span class="cx">         margin-right: 4%;
</span><ins>+}
+
+.media-sidebar .setting span,
+.compat-item label span {
+        float: left;
+        min-height: 22px;
</ins><span class="cx">         padding-top: 8px;
</span><span class="cx">         line-height: 16px;
</span><span class="cx">         text-align: right;
</span><ins>+        font-weight: normal;
</ins><span class="cx">         color: #999;
</span><span class="cx">         text-shadow: 0 1px 0 #fff;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .media-sidebar .setting input,
</span><del>-.media-sidebar .setting textarea {
-        float: right;
-        width: 65%;
</del><ins>+.media-sidebar .setting textarea,
+.compat-item .field input,
+.compat-item .field textarea {
</ins><span class="cx">         padding: 6px 8px;
</span><span class="cx">         line-height: 16px;
</span><del>-        resize: none;
</del><span class="cx"> }
</span><span class="cx">
</span><ins>+.media-sidebar .setting input,
</ins><span class="cx"> .media-sidebar .setting textarea {
</span><ins>+        width: 65%;
+        float: right;
+}
+
+.media-sidebar .setting textarea,
+.compat-item .field textarea {
</ins><span class="cx">         height: 62px;
</span><ins>+        resize: none;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.media-sidebar .setting select {
</del><ins>+.media-sidebar .setting select,
+.compat-item .field select {
</ins><span class="cx">         height: 28px;
</span><span class="cx">         line-height: 28px;
</span><span class="cx">         margin-top: 3px;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.compat-item {
+        float: left;
+        width: 100%;
+        overflow: hidden;
+}
</ins><span class="cx">
</span><ins>+.compat-item table {
+        width: 100%;
+        table-layout: fixed;
+        border-spacing: 0;
+        border: 0;
+}
+
+.compat-item tr {
+        padding: 2px 0;
+        display: block;
+        overflow: hidden;
+}
+
+.compat-item .label,
+.compat-item .field {
+        display: block;
+        margin: 0;
+        padding: 0;
+}
+
+.compat-item .label {
+        min-width: 30%;
+        margin-right: 4%;
+        float: left;
+        text-align: right;
+}
+.compat-item .label span {
+        display: block;
+        width: 100%;
+}
+
+.compat-item .field {
+        float: right;
+        width: 65%;
+        padding-right: 1px;
+}
+
+.compat-item .field input {
+        width: 100%;
+        margin: 0;
+}
+
+
</ins><span class="cx"> /**
</span><span class="cx"> * Menu
</span><span class="cx"> */
</span><span class="lines">@@ -855,7 +916,7 @@
</span><span class="cx">         color: #999;
</span><span class="cx">         border-bottom: 1px solid #e5e5e5;
</span><span class="cx">         box-shadow: 0 1px 0 #fff;
</span><del>-        padding-bottom: 16px;
</del><ins>+        padding-bottom: 11px;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .attachment-info .filename {
</span><span class="lines">@@ -869,6 +930,7 @@
</span><span class="cx">         max-width: 120px;
</span><span class="cx">         max-height: 120px;
</span><span class="cx">         margin-right: 10px;
</span><ins>+        margin-bottom: 5px;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .attachment-info .thumbnail:after {
</span><span class="lines">@@ -894,9 +956,17 @@
</span><span class="cx">         float: left;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.attachment-info .compat-meta {
+        float: left;
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * Attachment Display Settings
</span><span class="cx"> */
</span><ins>+.attachment-display-settings {
+        overflow: hidden;
+        float: left;
+}
</ins><span class="cx">
</span><span class="cx"> .attachment-display-settings h4 {
</span><span class="cx">         margin: 1.4em 0 0.4em;
</span></span></pre></div>
<a id="trunkwpincludesjsmediamodelsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-models.js (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-models.js        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-includes/js/media-models.js        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -245,6 +245,17 @@
</span><span class="cx">                         resp.date = new Date( resp.date );
</span><span class="cx">                         resp.modified = new Date( resp.modified );
</span><span class="cx">                         return resp;
</span><ins>+                },
+
+                saveCompat: function( data, options ) {
+                        var model = this;
+
+                        return media.post( 'save-attachment-compat', _.defaults({
+                                id: this.id,
+                                nonce: l10n.saveAttachmentNonce
+                        }, data ) ).done( function( resp, status, xhr ) {
+                                model.set( model.parse( resp, xhr ), options );
+                        });
</ins><span class="cx">                 }
</span><span class="cx">         }, {
</span><span class="cx">                 create: function( attrs ) {
</span></span></pre></div>
<a id="trunkwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.js (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.js        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-includes/js/media-views.js        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -832,17 +832,28 @@
</span><span class="cx">                 },
</span><span class="cx">
</span><span class="cx">                 settingsSidebar: function( options ) {
</span><ins>+                        var single = this.state().get('selection').single(),
+                                views = {};
+
+                        views.details = new media.view.Attachment.Details({
+                                controller: this,
+                                model: single,
+                                priority: 80
+                        }).render();
+
+
+                        if ( single.get('compat') ) {
+                                views.compat = new media.view.AttachmentCompat({
+                                        controller: this,
+                                        model: single,
+                                        priority: 120
+                                }).render();
+                        }
+
</ins><span class="cx">                         this.sidebar.view( new media.view.Sidebar({
</span><span class="cx">                                 controller: this,
</span><span class="cx">                                 silent: options && options.silent,
</span><del>-
-                                views: {
-                                        details: new media.view.Attachment.Details({
-                                                controller: this,
-                                                model: this.state().get('selection').single(),
-                                                priority: 80
-                                        }).render()
-                                }
</del><ins>+                                views: views
</ins><span class="cx">                         }) );
</span><span class="cx">                 },
</span><span class="cx">
</span><span class="lines">@@ -1145,7 +1156,7 @@
</span><span class="cx">                                         controller: this,
</span><span class="cx">                                         model: display[ single.cid ],
</span><span class="cx">                                         sizes: single.get('sizes'),
</span><del>-                                        priority: 100,
</del><ins>+                                        priority: 160,
</ins><span class="cx">                                         userSettings: state.get('displayUserSettings')
</span><span class="cx">                                 }).render()
</span><span class="cx">                         }, options );
</span><span class="lines">@@ -2639,6 +2650,54 @@
</span><span class="cx">         });
</span><span class="cx">
</span><span class="cx">         /**
</span><ins>+         * wp.media.view.AttachmentCompat
+         */
+        media.view.AttachmentCompat = Backbone.View.extend({
+                tagName: 'form',
+                className: 'compat-item',
+
+                events: {
+                        'submit': 'preventDefault',
+                        'change input': 'save',
+                        'change select': 'save',
+                        'change textarea': 'save'
+                },
+
+                initialize: function() {
+                        this.model.on( 'change:compat', this.render, this );
+                },
+
+                destroy: function() {
+                        this.model.off( null, null, this );
+                },
+
+                render: function() {
+                        var compat = this.model.get('compat');
+                        if ( ! compat || ! compat.item )
+                                return;
+
+                        this.$el.html( compat.item );
+                        return this;
+                },
+
+                preventDefault: function( event ) {
+                        event.preventDefault();
+                },
+
+                save: function( event ) {
+                        var data = {};
+
+                        event.preventDefault();
+
+                        _.each( this.$el.serializeArray(), function( pair ) {
+                                data[ pair.name ] = pair.value;
+                        });
+
+                        this.model.saveCompat( data );
+                }
+        });
+
+        /**
</ins><span class="cx">          * wp.media.view.Iframe
</span><span class="cx">          */
</span><span class="cx">         media.view.Iframe = Backbone.View.extend({
</span></span></pre></div>
<a id="trunkwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/media.php (22540 => 22541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media.php        2012-11-10 22:58:34 UTC (rev 22540)
+++ trunk/wp-includes/media.php        2012-11-11 01:26:42 UTC (rev 22541)
</span><span class="lines">@@ -1288,6 +1288,9 @@
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if ( function_exists('get_compat_media_markup') )
+                $response['compat'] = get_compat_media_markup( $attachment->ID );
+
</ins><span class="cx">         return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1455,6 +1458,11 @@
</span><span class="cx">                                         <div class="dimensions">{{ width }} &times; {{ height }}</div>
</span><span class="cx">                                 <# } #>
</span><span class="cx">                         </div>
</span><ins>+                        <div class="compat-meta">
+                                <# if ( compat && compat.meta ) { #>
+                                        {{{ compat.meta }}}
+                                <# } #>
+                        </div>
</ins><span class="cx">                 </div>
</span><span class="cx">
</span><span class="cx">                 <# if ( 'image' === type ) { #>
</span></span></pre>
</div>
</div>
</body>
</html>