当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_underscore_video_template函数代码示例

本文整理汇总了PHP中wp_underscore_video_template函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_underscore_video_template函数的具体用法?PHP wp_underscore_video_template怎么用?PHP wp_underscore_video_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wp_underscore_video_template函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wp_print_media_templates


//.........这里部分代码省略.........
				<label class="setting checkbox-setting">
					<input type="checkbox" data-setting="autoplay" />
					<span><?php _e( 'Autoplay' ); ?></span>
				</label>

				<label class="setting checkbox-setting">
					<input type="checkbox" data-setting="loop" />
					<span><?php _e( 'Loop' ); ?></span>
				</label>
			</div>
		</div>
	</script>

	<script type="text/html" id="tmpl-video-details">
		<# var ext, html5types = {
			mp4: wp.media.view.settings.embedMimes.mp4,
			ogv: wp.media.view.settings.embedMimes.ogv,
			webm: wp.media.view.settings.embedMimes.webm
		}; #>

		<?php $video_types = wp_get_video_extensions(); ?>
		<div class="media-embed media-embed-details">
			<div class="embed-media-settings embed-video-settings">
				<div class="wp-video-holder">
				<#
				var w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width,
					h = ! data.model.height ? 360 : data.model.height;

				if ( data.model.width && w !== data.model.width ) {
					h = Math.ceil( ( h * w ) / data.model.width );
				}
				#>

				<?php wp_underscore_video_template() ?>

				<# if ( ! _.isEmpty( data.model.src ) ) {
					ext = data.model.src.split('.').pop();
					if ( html5types[ ext ] ) {
						delete html5types[ ext ];
					}
				#>
				<label class="setting">
					<span>SRC</span>
					<input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" />
					<a class="remove-setting"><?php _e( 'Remove' ); ?></a>
				</label>
				<# } #>
				<?php foreach ( $video_types as $type ):
				?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) {
					if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) {
						delete html5types.<?php echo $type ?>;
					}
				#>
				<label class="setting">
					<span><?php echo strtoupper( $type ) ?></span>
					<input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
					<a class="remove-setting"><?php _e( 'Remove' ); ?></a>
				</label>
				<# } #>
				<?php endforeach ?>
				</div>

				<# if ( ! _.isEmpty( html5types ) ) { #>
				<div class="setting">
					<span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ); ?></span>
					<div class="button-large">
开发者ID:ShankarVellal,项目名称:WordPress,代码行数:67,代码来源:media-template.php

示例2: wp_print_media_templates


//.........这里部分代码省略.........
					<span><?php 
    _e('Loop');
    ?>
</span>
				</label>
			</div>
		</div>
	</script>

	<script type="text/html" id="tmpl-video-details">
		<# var ext, html5types = {
			mp4: wp.media.view.settings.embedMimes.mp4,
			ogv: wp.media.view.settings.embedMimes.ogv,
			webm: wp.media.view.settings.embedMimes.webm
		}; #>

		<?php 
    $video_types = wp_get_video_extensions();
    ?>
		<div class="media-embed media-embed-details">
			<div class="embed-media-settings embed-video-settings">
				<div class="wp-video-holder">
				<#
				var isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/);
					w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width,
					h = ! data.model.height ? 360 : data.model.height;

				if ( data.model.width && w !== data.model.width ) {
					h = Math.ceil( ( h * w ) / data.model.width );
				}
				#>

				<?php 
    wp_underscore_video_template();
    ?>

				<# if ( ! _.isEmpty( data.model.src ) ) {
					ext = data.model.src.split('.').pop();
					if ( html5types[ ext ] ) {
						delete html5types[ ext ];
					}
				#>
				<label class="setting">
					<span>SRC</span>
					<input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" />
					<a class="remove-setting"><?php 
    _e('Remove');
    ?>
</a>
				</label>
				<# } #>
				<?php 
    foreach ($video_types as $type) {
        ?>
<# if ( ! _.isEmpty( data.model.<?php 
        echo $type;
        ?>
 ) ) {
					if ( ! _.isUndefined( html5types.<?php 
        echo $type;
        ?>
 ) ) {
						delete html5types.<?php 
        echo $type;
        ?>
;
开发者ID:valiror,项目名称:sharingdais_demo1,代码行数:67,代码来源:media-template.php


注:本文中的wp_underscore_video_template函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。