Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/wp-admin/includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -3274,7 +3274,17 @@ function edit_form_image_editor( $post ) {
<?php endif; ?>

<p>
<label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />
<label for="attachment_caption"><strong>
<?php
if ( str_starts_with( $post->post_mime_type, 'video' ) ) {
esc_html_e( 'Video Description' );
} elseif ( str_starts_with( $post->post_mime_type, 'image' ) ) {
esc_html_e( 'Image Caption' );
} else {
esc_html_e( 'Caption' );
}
Comment thread
himanshupathak95 marked this conversation as resolved.
?>
</strong></label><br />
<textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea>
</p>

Expand Down
16 changes: 14 additions & 2 deletions src/wp-includes/media-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,13 @@ function wp_print_media_templates() {
<?php endforeach; ?>
<# } #>
<span class="setting" data-setting="caption">
<label for="attachment-details-two-column-caption" class="name"><?php _e( 'Caption' ); ?></label>
<# if ( 'video' === data.type ) { #>
<label for="attachment-details-two-column-caption" class="name"><?php esc_html_e( 'Video Description' ); ?></label>
<# } else if ( 'image' === data.type ) { #>
<label for="attachment-details-two-column-caption" class="name"><?php esc_html_e( 'Image Caption' ); ?></label>
<# } else { #>
Comment thread
himanshupathak95 marked this conversation as resolved.
<label for="attachment-details-two-column-caption" class="name"><?php esc_html_e( 'Caption' ); ?></label>
<# } #>
<textarea id="attachment-details-two-column-caption" {{ maybeReadOnly }}>{{ data.caption }}</textarea>
</span>
<span class="setting" data-setting="description">
Expand Down Expand Up @@ -790,7 +796,13 @@ function wp_print_media_templates() {
<?php endforeach; ?>
<# } #>
<span class="setting" data-setting="caption">
<label for="attachment-details-caption" class="name"><?php _e( 'Caption' ); ?></label>
<# if ( 'video' === data.type ) { #>
<label for="attachment-details-caption" class="name"><?php esc_html_e( 'Video Description' ); ?></label>
<# } else if ( 'image' === data.type ) { #>
<label for="attachment-details-caption" class="name"><?php esc_html_e( 'Image Caption' ); ?></label>
<# } else { #>
Comment thread
himanshupathak95 marked this conversation as resolved.
<label for="attachment-details-caption" class="name"><?php esc_html_e( 'Caption' ); ?></label>
<# } #>
<textarea id="attachment-details-caption" {{ maybeReadOnly }}>{{ data.caption }}</textarea>
</span>
<span class="setting" data-setting="description">
Expand Down
Loading