WP_Widget_Media::render_control_template_scripts()

Render form template scripts.


Source

File: wp-includes/widgets/class-wp-widget-media.php. View all references

public function render_control_template_scripts() {
	?>
	<script type="text/html" id="tmpl-widget-media-<?php echo esc_attr( $this->id_base ); ?>-control">
		<# var elementIdPrefix = 'el' + String( Math.random() ) + '_' #>
		<p>
			<label for="{{ elementIdPrefix }}title"><?php esc_html_e( 'Title:' ); ?></label>
			<input id="{{ elementIdPrefix }}title" type="text" class="widefat title">
		</p>
		<div class="media-widget-preview <?php echo esc_attr( $this->id_base ); ?>">
			<div class="attachment-media-view">
				<button type="button" class="select-media button-add-media not-selected">
					<?php echo esc_html( $this->l10n['add_media'] ); ?>
				</button>
			</div>
		</div>
		<p class="media-widget-buttons">
			<button type="button" class="button edit-media selected">
				<?php echo esc_html( $this->l10n['edit_media'] ); ?>
			</button>
		<?php if ( ! empty( $this->l10n['replace_media'] ) ) : ?>
			<button type="button" class="button change-media select-media selected">
				<?php echo esc_html( $this->l10n['replace_media'] ); ?>
			</button>
		<?php endif; ?>
		</p>
		<div class="media-widget-fields">
		</div>
	</script>
	<?php
}


Top ↑

Changelog

Changelog
Version Description
4.8.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.