Add support for `attachment_fields_to_edit` in the attachment details modal. props ericlewis. fixes #28991, see #24716.
git-svn-id: https://develop.svn.wordpress.org/trunk@29278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
15aaf0691a
commit
3d3b141b30
|
@ -440,6 +440,16 @@
|
||||||
controller: this,
|
controller: this,
|
||||||
model: this.model
|
model: this.model
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach a subview to display fields added via the
|
||||||
|
* `attachment_fields_to_edit` filter.
|
||||||
|
*/
|
||||||
|
contentRegion.view.views.set( '.attachment-compat', new media.view.AttachmentCompat({
|
||||||
|
controller: this,
|
||||||
|
model: this.model
|
||||||
|
}) );
|
||||||
|
|
||||||
// Update browser url when navigating media details
|
// Update browser url when navigating media details
|
||||||
if ( this.model ) {
|
if ( this.model ) {
|
||||||
this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
|
this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
|
||||||
|
@ -678,4 +688,4 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}(jQuery, _, Backbone, wp));
|
}(jQuery, _, Backbone, wp));
|
||||||
|
|
|
@ -6407,6 +6407,8 @@
|
||||||
/**
|
/**
|
||||||
* wp.media.view.AttachmentCompat
|
* wp.media.view.AttachmentCompat
|
||||||
*
|
*
|
||||||
|
* A view to display fields added via the `attachment_fields_to_edit` filter.
|
||||||
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @augments wp.media.View
|
* @augments wp.media.View
|
||||||
* @augments wp.Backbone.View
|
* @augments wp.Backbone.View
|
||||||
|
|
|
@ -386,6 +386,7 @@ function wp_print_media_templates() {
|
||||||
<span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
|
<span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
|
||||||
</label>
|
</label>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
<div class="attachment-compat"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> |
|
<a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> |
|
||||||
|
|
Loading…
Reference in New Issue