: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<# if ( data.mediaStates ) { #>
<div class="media-states"><strong><?php _e( 'Used as:' ); ?></strong> {{ data.mediaStates }}</div>
<div class="compat-meta">
<# if ( data.compat && data.compat.meta ) { #>
<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
<# if ( 'image' === data.type ) { #>
<span class="setting alt-text has-description" data-setting="alt">
<label for="attachment-details-two-column-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label>
<textarea id="attachment-details-two-column-alt-text" aria-describedby="alt-text-description" {{ maybeReadOnly }}>{{ data.alt }}</textarea>
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
<span class="setting" data-setting="title">
<label for="attachment-details-two-column-title" class="name"><?php _e( 'Title' ); ?></label>
<input type="text" id="attachment-details-two-column-title" value="{{ data.title }}" {{ maybeReadOnly }} />
<# if ( 'audio' === data.type ) { #>
'artist' => __( 'Artist' ),
'album' => __( 'Album' ),
<span class="setting" data-setting="<?php echo esc_attr( $key ); ?>">
<label for="attachment-details-two-column-<?php echo esc_attr( $key ); ?>" class="name"><?php echo $label; ?></label>
<input type="text" id="attachment-details-two-column-<?php echo esc_attr( $key ); ?>" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" />
<span class="setting" data-setting="caption">
<label for="attachment-details-two-column-caption" class="name"><?php _e( 'Caption' ); ?></label>
<textarea id="attachment-details-two-column-caption" {{ maybeReadOnly }}>{{ data.caption }}</textarea>
<span class="setting" data-setting="description">
<label for="attachment-details-two-column-description" class="name"><?php _e( 'Description' ); ?></label>
<textarea id="attachment-details-two-column-description" {{ maybeReadOnly }}>{{ data.description }}</textarea>
<span class="setting" data-setting="url">
<label for="attachment-details-two-column-copy-link" class="name"><?php _e( 'File URL:' ); ?></label>
<input type="text" class="attachment-details-copy-link" id="attachment-details-two-column-copy-link" value="{{ data.url }}" readonly />
<span class="copy-to-clipboard-container">
<button type="button" class="button button-small copy-attachment-url" data-clipboard-target="#attachment-details-two-column-copy-link"><?php _e( 'Copy URL to clipboard' ); ?></button>
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
<div class="attachment-compat"></div>
$view_media_text = ( '1' === get_option( 'wp_attachment_pages_enabled' ) ) ? __( 'View attachment page' ) : __( 'View media file' );
<a class="view-attachment" href="{{ data.link }}"><?php echo $view_media_text; ?></a>
<# if ( data.can.save ) { #>
<span class="links-separator">|</span>
<a href="{{ data.editLink }}"><?php _e( 'Edit more details' ); ?></a>
<# if ( data.can.save && data.link ) { #>
<span class="links-separator">|</span>
<a href="{{ data.url }}" download><?php _e( 'Download file' ); ?></a>
<# if ( ! data.uploading && data.can.remove ) { #>
<# if ( data.link || data.can.save ) { #>
<span class="links-separator">|</span>
<?php if ( MEDIA_TRASH ) : ?>
<# if ( 'trash' === data.status ) { #>
<button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button>
<button type="button" class="button-link trash-attachment"><?php _e( 'Move to Trash' ); ?></button>
<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' ); ?></button>
<?php // Template for the Attachment "thumbnails" in the Media Grid. ?>
<script type="text/html" id="tmpl-attachment">
<div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div>
<# } else if ( 'image' === data.type && data.size && data.size.url ) { #>
<img src="{{ data.size.url }}" draggable="false" alt="" />
<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
<img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" />
<# } else if ( data.sizes && data.sizes.medium ) { #>
<img src="{{ data.sizes.medium.url }}" class="thumbnail" draggable="false" alt="" />
<img src="{{ data.icon }}" class="icon" draggable="false" alt="" />
<div>{{ data.filename }}</div>
<# if ( data.buttons.close ) { #>
<button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text">
/* translators: Hidden accessibility text. */
<# if ( data.buttons.check ) { #>
<button type="button" class="check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text">
/* translators: Hidden accessibility text. */
var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly';
if ( 'image' === data.type ) { #>
<input type="text" value="{{ data.caption }}" class="describe" data-setting="caption"
aria-label="<?php esc_attr_e( 'Caption' ); ?>"
placeholder="<?php esc_attr_e( 'Caption…' ); ?>" {{ maybeReadOnly }} />
<input type="text" value="{{ data.title }}" class="describe" data-setting="title"
<# if ( 'video' === data.type ) { #>
aria-label="<?php esc_attr_e( 'Video title' ); ?>"
placeholder="<?php esc_attr_e( 'Video title…' ); ?>"
<# } else if ( 'audio' === data.type ) { #>
aria-label="<?php esc_attr_e( 'Audio title' ); ?>"
placeholder="<?php esc_attr_e( 'Audio title…' ); ?>"
aria-label="<?php esc_attr_e( 'Media title' ); ?>"
placeholder="<?php esc_attr_e( 'Media title…' ); ?>"
<# } #> {{ maybeReadOnly }} />
<?php // Template for the Attachment details, used for example in the sidebar. ?>
<script type="text/html" id="tmpl-attachment-details">
<?php _e( 'Attachment Details' ); ?>
<span class="settings-save-status" role="status">
<span class="spinner"></span>
<span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
<div class="attachment-info">
<# if ( 'audio' === data.type ) { #>
<div class="wp-media-wrapper wp-audio">
<audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none">
<source type="{{ data.mime }}" src="{{ data.url }}" />
<# } else if ( 'video' === data.type ) {
w_rule = 'width: ' + data.width + 'px;';
} else if ( wp.media.view.settings.contentWidth ) {
w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;';
<div style="{{ w_rule }}" class="wp-media-wrapper wp-video">
<video controls="controls" class="wp-video-shortcode" preload="metadata"
<# if ( data.width ) { #>width="{{ data.width }}"<# } #>
<# if ( data.height ) { #>height="{{ data.height }}"<# } #>
<# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>>
<source type="{{ data.mime }}" src="{{ data.url }}" />
<div class="thumbnail thumbnail-{{ data.type }}">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div></div></div>
<# } else if ( 'image' === data.type && data.size && data.size.url ) { #>
<img src="{{ data.size.url }}" draggable="false" alt="" />
<img src="{{ data.icon }}" class="icon" draggable="false" alt="" />
<div class="filename">{{ data.filename }}</div>
<div class="uploaded">{{ data.dateFormatted }}</div>
<div class="file-size">{{ data.filesizeHumanReadable }}</div>
<# if ( 'image' === data.type && ! data.uploading ) { #>
<# if ( data.width && data.height ) { #>
/* translators: 1: A number of pixels wide, 2: A number of pixels tall. */
printf( __( '%1$s by %2$s pixels' ), '{{ data.width }}', '{{ data.height }}' );
<# if ( data.originalImageURL && data.originalImageName ) { #>
<div class="word-wrap-break-word">
<?php _e( 'Original image:' ); ?>
<a href="{{ data.originalImageURL }}">{{data.originalImageName}}</a>
<# if ( data.can.save && data.sizes ) { #>
<a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a>
<# if ( data.fileLength && data.fileLengthHumanReadable ) { #>
<div class="file-length"><?php _e( 'Length:' ); ?>
<span aria-hidden="true">{{ data.fileLengthHumanReadable }}</span>
<span class="screen-reader-text">{{ data.fileLengthHumanReadable }}</span>
<# if ( data.mediaStates ) { #>
<div class="media-states"><strong><?php _e( 'Used as:' ); ?></strong> {{ data.mediaStates }}</div>
<# if ( ! data.uploading && data.can.remove ) { #>
<?php if ( MEDIA_TRASH ) : ?>
<# if ( 'trash' === data.status ) { #>
<button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button>
<button type="button" class="button-link trash-attachment"><?php _e( 'Move to Trash' ); ?></button>
<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' ); ?></button>
<div class="compat-meta">
<# if ( data.compat && data.compat.meta ) { #>
<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
<# if ( 'image' === data.type ) { #>
<span class="setting alt-text has-description" data-setting="alt">
<label for="attachment-details-alt-text" class="name"><?php _e( 'Alt Text' ); ?></label>
<textarea id="attachment-details-alt-text" aria-describedby="alt-text-description" {{ maybeReadOnly }}>{{ data.alt }}</textarea>
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
<span class="setting" data-setting="title">
<label for="attachment-details-title" class="name"><?php _e( 'Title' ); ?></label>
<input type="text" id="attachment-details-title" value="{{ data.title }}" {{ maybeReadOnly }} />
<# if ( 'audio' === data.type ) { #>
'artist' => __( 'Artist' ),
'album' => __( 'Album' ),
<span class="setting" data-setting="<?php echo esc_attr( $key ); ?>">
<label for="attachment-details-<?php echo esc_attr( $key ); ?>" class="name"><?php echo $label; ?></label>
<input type="text" id="attachment-details-<?php echo esc_attr( $key ); ?>" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" />
<span class="setting" data-setting="caption">
<label for="attachment-details-caption" class="name"><?php _e( 'Caption' ); ?></label>
<textarea id="attachment-details-caption" {{ maybeReadOnly }}>{{ data.caption }}</textarea>
<span class="setting" data-setting="description">
<label for="attachment-details-description" class="name"><?php _e( 'Description' ); ?></label>
<textarea id="attachment-details-description" {{ maybeReadOnly }}>{{ data.description }}</textarea>
<span class="setting" data-setting="url">
<label for="attachment-details-copy-link" class="name"><?php _e( 'File URL:' ); ?></label>
<input type="text" class="attachment-details-copy-link" id="attachment-details-copy-link" value="{{ data.url }}" readonly />
<div class="copy-to-clipboard-container">
<button type="button" class="button button-small copy-attachment-url" data-clipboard-target="#attachment-details-copy-link"><?php _e( 'Copy URL to clipboard' ); ?></button>
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
<?php // Template for the Selection status bar. ?>
<script type="text/html" id="tmpl-media-selection">
<div class="selection-info">
<span class="count"></span>
<# if ( data.editable ) { #>
<button type="button" class="button-link edit-selection"><?php _e( 'Edit Selection' ); ?></button>
<# if ( data.clearable ) { #>
<button type="button" class="button-link clear-selection"><?php _e( 'Clear' ); ?></button>
<div class="selection-view"></div>
<?php // Template for the Attachment display settings, used for example in the sidebar. ?>
<script type="text/html" id="tmpl-attachment-display-settings">
<h2><?php _e( 'Attachment Display Settings' ); ?></h2>
<# if ( 'image' === data.type ) { #>
<span class="setting align">
<label for="attachment-display-settings-alignment" class="name"><?php _e( 'Alignment' ); ?></label>
<select id="attachment-display-settings-alignment" class="alignment"
<# if ( data.userSettings ) { #>
data-user-setting="align"
<?php esc_html_e( 'Left' ); ?>
<?php esc_html_e( 'Center' ); ?>
<?php esc_html_e( 'Right' ); ?>
<option value="none" selected>
<?php echo esc_html_x( 'None', 'Alignment option' ); ?>
<label for="attachment-display-settings-link-to" class="name">
<# if ( data.model.canEmbed ) { #>
<?php _e( 'Embed or Link' ); ?>
<?php _e( 'Link To' ); ?>
<select id="attachment-display-settings-link-to" class="link-to"
<# if ( data.userSettings && ! data.model.canEmbed ) { #>
data-user-setting="urlbutton"
<# if ( data.model.canEmbed ) { #>
<option value="embed" selected>
<?php esc_html_e( 'Embed Media Player' ); ?>
<option value="none" selected>
<?php echo esc_html_x( 'None', 'Media item link option' ); ?>
<# if ( data.model.canEmbed ) { #>
<?php esc_html_e( 'Link to Media File' ); ?>
<?php esc_html_e( 'Media File' ); ?>
<# if ( data.model.canEmbed ) { #>
<?php esc_html_e( 'Link to Attachment Page' ); ?>
<?php esc_html_e( 'Attachment Page' ); ?>
<# if ( 'image' === data.type ) { #>
<?php esc_html_e( 'Custom URL' ); ?>
<label for="attachment-display-settings-link-to-custom" class="name"><?php _e( 'URL' ); ?></label>
<input type="text" id="attachment-display-settings-link-to-custom" class="link-to-custom" data-setting="linkUrl" />
<# if ( 'undefined' !== typeof data.sizes ) { #>
<label for="attachment-display-settings-size" class="name"><?php _e( 'Size' ); ?></label>
<select id="attachment-display-settings-size" class="size" name="size"
<# if ( data.userSettings ) { #>
data-user-setting="imgsize"
/** This filter is documented in wp-admin/includes/media.php */
'image_size_names_choose',
'thumbnail' => __( 'Thumbnail' ),
'medium' => __( 'Medium' ),
'large' => __( 'Large' ),
'full' => __( 'Full Size' ),
foreach ( $sizes as $value => $name ) :
var size = data.sizes['<?php echo esc_js( $value ); ?>'];
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'full' ); ?>>
<?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }}
<?php // Template for the Gallery settings, used for example in the sidebar. ?>
<script type="text/html" id="tmpl-gallery-settings">
<h2><?php _e( 'Gallery Settings' ); ?></h2>
<label for="gallery-settings-link-to" class="name"><?php _e( 'Link To' ); ?></label>
<select id="gallery-settings-link-to" class="link-to"
<# if ( data.userSettings ) { #>
data-user-setting="urlbutton"
<option value="post" <# if ( ! wp.media.galleryDefaults.link || 'post' === wp.media.galleryDefaults.link ) {
#>selected="selected"<# }
<?php esc_html_e( 'Attachment Page' ); ?>
<option value="file" <# if ( 'file' === wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>>
<?php esc_html_e( 'Media File' ); ?>
<option value="none" <# if ( 'none' === wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>>
<?php echo esc_html_x( 'None', 'Media item link option' ); ?>
<label for="gallery-settings-columns" class="name select-label-inline"><?php _e( 'Columns' ); ?></label>
<select id="gallery-settings-columns" class="columns" name="columns"
<?php for ( $i = 1; $i <= 9; $i++ ) : ?>
<option value="<?php echo esc_attr( $i ); ?>" <#
if ( <?php echo $i; ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# }
<?php echo esc_html( $i ); ?>
<input type="checkbox" id="gallery-settings-random-order" data-setting="_orderbyRandom" />
<label for="gallery-settings-random-order" class="checkbox-label-inline"><?php _e( 'Random Order' ); ?></label>
<span class="setting size">
<label for="gallery-settings-size" class="name"><?php _e( 'Size' ); ?></label>
<select id="gallery-settings-size" class="size" name="size"
<# if ( data.userSettings ) { #>
data-user-setting="imgsize"
/** This filter is documented in wp-admin/includes/media.php */
$size_names = apply_filters(
'image_size_names_choose',
'thumbnail' => __( 'Thumbnail' ),
'medium' => __( 'Medium' ),
'large' => __( 'Large' ),
'full' => __( 'Full Size' ),
foreach ( $size_names as $size => $label ) :