mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Media: Add 'Uploaded to' for individual media items in the media editor.
Adds a link in the media editor showing which post a media item was uploaded to. Props karmatosed, garrett-eclipse, Mista-Flo, SergeyBiryukov, joemcgill, hellofromTonya. Fixes #46866. git-svn-id: https://develop.svn.wordpress.org/trunk@49207 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -458,6 +458,8 @@ form#tags-filter {
|
||||
#post-body .misc-pub-post-status:before,
|
||||
#post-body #visibility:before,
|
||||
.curtime #timestamp:before,
|
||||
#post-body .misc-pub-uploadedby:before,
|
||||
#post-body .misc-pub-uploadedto:before,
|
||||
#post-body .misc-pub-revisions:before,
|
||||
#post-body .misc-pub-response-to:before,
|
||||
#post-body .misc-pub-comment-status:before {
|
||||
@@ -467,6 +469,8 @@ form#tags-filter {
|
||||
#post-body .misc-pub-post-status:before,
|
||||
#post-body #visibility:before,
|
||||
.curtime #timestamp:before,
|
||||
#post-body .misc-pub-uploadedby:before,
|
||||
#post-body .misc-pub-uploadedto:before,
|
||||
#post-body .misc-pub-revisions:before,
|
||||
#post-body .misc-pub-response-to:before,
|
||||
#post-body .misc-pub-comment-status:before {
|
||||
@@ -495,6 +499,18 @@ form#tags-filter {
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
#post-body .misc-pub-uploadedby:before {
|
||||
content: "\f110";
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
#post-body .misc-pub-uploadedto:before {
|
||||
content: "\f318";
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
#post-body .misc-pub-revisions:before {
|
||||
content: "\f321";
|
||||
}
|
||||
|
||||
@@ -3288,7 +3288,37 @@ function attachment_submitbox_metadata() {
|
||||
|
||||
$att_url = wp_get_attachment_url( $attachment_id );
|
||||
|
||||
?>
|
||||
$author = get_userdata( $post->post_author );
|
||||
|
||||
$uploaded_by_name = __( '(no author)' );
|
||||
$uploaded_by_link = '';
|
||||
if ( $author->exists() ) {
|
||||
$uploaded_by_name = $author->display_name ? $author->display_name : $author->nickname;
|
||||
$uploaded_by_link = get_edit_user_link( $author->ID );
|
||||
} ?>
|
||||
<div class="misc-pub-section misc-pub-uploadedby">
|
||||
<?php if ( $uploaded_by_link ) : ?>
|
||||
<?php _e( 'Uploaded by:' ); ?> <a href="<?php echo $uploaded_by_link ?>"><strong><?php echo $uploaded_by_name ?></strong></a>
|
||||
<?php else: ?>
|
||||
<?php _e( 'Uploaded by:' ); ?> <strong><?php echo $uploaded_by_name ?></strong>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $post->post_parent ) :
|
||||
$post_parent = get_post( $post->post_parent );
|
||||
if ( $post_parent ) :
|
||||
$uploaded_to_title = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );
|
||||
$uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' ); ?>
|
||||
<div class="misc-pub-section misc-pub-uploadedto">
|
||||
<?php if ( $uploaded_to_link ) : ?>
|
||||
<?php _e( 'Uploaded to:' ); ?> <a href="<?php echo $uploaded_to_link ?>"><strong><?php echo $uploaded_to_title; ?></strong></a>
|
||||
<?php else: ?>
|
||||
<?php _e( 'Uploaded to:' ); ?> <strong><?php echo $uploaded_to_title; ?></strong>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="misc-pub-section misc-pub-attachment">
|
||||
<label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
|
||||
<input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
|
||||
|
||||
Reference in New Issue
Block a user