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


PHP wp_underscore_playlist_templates函数代码示例

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


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

示例1: wp_print_media_templates


//.........这里部分代码省略.........
	<script type="text/html" id="tmpl-editor-gallery">
		<div class="toolbar">
			<div class="dashicons dashicons-edit edit"></div><div class="dashicons dashicons-no-alt remove"></div>
		</div>
		<# if ( data.attachments ) { #>
			<div class="gallery gallery-columns-{{ data.columns }}">
				<# _.each( data.attachments, function( attachment, index ) { #>
					<dl class="gallery-item">
						<dt class="gallery-icon">
							<# if ( attachment.thumbnail ) { #>
								<img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
							<# } else { #>
								<img src="{{ attachment.url }}" />
							<# } #>
						</dt>
						<dd class="wp-caption-text gallery-caption">
							{{ attachment.caption }}
						</dd>
					</dl>
					<# if ( index % data.columns === data.columns - 1 ) { #>
						<br style="clear: both;">
					<# } #>
				<# } ); #>
			</div>
		<# } else { #>
			<div class="wpview-error">
				<div class="dashicons dashicons-format-gallery"></div><p><?php 
    _e('No items found.');
    ?>
</p>
			</div>
		<# } #>
	</script>

	<script type="text/html" id="tmpl-editor-audio">
		<div class="toolbar">
			<div class="dashicons dashicons-edit edit"></div>
			<div class="dashicons dashicons-no-alt remove"></div>
		</div>
		<?php 
    wp_underscore_audio_template();
    ?>
		<div class="wpview-overlay"></div>
	</script>

	<script type="text/html" id="tmpl-editor-video">
		<div class="toolbar">
			<div class="dashicons dashicons-edit edit"></div>
			<div class="dashicons dashicons-no-alt remove"></div>
		</div>
		<?php 
    wp_underscore_video_template();
    ?>
		<div class="wpview-overlay"></div>
	</script>

	<?php 
    wp_underscore_playlist_templates();
    ?>

	<script type="text/html" id="tmpl-editor-playlist">
		<div class="toolbar">
			<div class="dashicons dashicons-edit edit"></div>
			<div class="dashicons dashicons-no-alt remove"></div>
		</div>
		<# if ( data.tracks ) { #>
			<div class="wp-playlist wp-{{ data.type }}-playlist wp-playlist-{{ data.style }}">
				<# if ( 'audio' === data.type ){ #>
				<div class="wp-playlist-current-item"></div>
				<# } #>
				<{{ data.type }} controls="controls" preload="none" <#
					if ( data.width ) { #> width="{{ data.width }}"<# }
					#><# if ( data.height ) { #> height="{{ data.height }}"<# } #>></{{ data.type }}>
				<div class="wp-playlist-next"></div>
				<div class="wp-playlist-prev"></div>
			</div>
			<div class="wpview-overlay"></div>
		<# } else { #>
			<div class="wpview-error">
				<div class="dashicons dashicons-video-alt3"></div><p><?php 
    _e('No items found.');
    ?>
</p>
			</div>
		<# } #>
	</script>

	<script type="text/html" id="tmpl-crop-content">
		<img class="crop-image" src="{{ data.url }}">
		<div class="upload-errors"></div>
	</script>

	<?php 
    /**
     * Fires when the custom Backbone media templates are printed.
     *
     * @since 3.5.0
     */
    do_action('print_media_templates');
}
开发者ID:valiror,项目名称:sharingdais_demo1,代码行数:101,代码来源:media-template.php

示例2: wp_ajax_parse_media_shortcode

/**
 * @since 4.0.0
 *
 * @global WP_Post    $post
 * @global WP_Scripts $wp_scripts
 */
function wp_ajax_parse_media_shortcode()
{
    global $post, $wp_scripts;
    if (empty($_POST['shortcode'])) {
        wp_send_json_error();
    }
    $shortcode = wp_unslash($_POST['shortcode']);
    if (!empty($_POST['post_ID'])) {
        $post = get_post((int) $_POST['post_ID']);
    }
    // the embed shortcode requires a post
    if (!$post || !current_user_can('edit_post', $post->ID)) {
        if ('embed' === $shortcode) {
            wp_send_json_error();
        }
    } else {
        setup_postdata($post);
    }
    $parsed = do_shortcode($shortcode);
    if (empty($parsed)) {
        wp_send_json_error(array('type' => 'no-items', 'message' => __('No items found.')));
    }
    $head = '';
    $styles = wpview_media_sandbox_styles();
    foreach ($styles as $style) {
        $head .= '<link type="text/css" rel="stylesheet" href="' . $style . '">';
    }
    if (!empty($wp_scripts)) {
        $wp_scripts->done = array();
    }
    ob_start();
    echo $parsed;
    if ('playlist' === $_REQUEST['type']) {
        wp_underscore_playlist_templates();
        wp_print_scripts('wp-playlist');
    } else {
        wp_print_scripts(array('froogaloop', 'wp-mediaelement'));
    }
    wp_send_json_success(array('head' => $head, 'body' => ob_get_clean()));
}
开发者ID:hughnet,项目名称:WordPress,代码行数:46,代码来源:ajax-actions.php

示例3: isset

    $playlist_settings .= isset($settings->artists) ? ' artists="' . $settings->artists . '"' : '';
    ?>
	<div class="fl-audio fl-wp-audio">
		<?php 
    echo '[playlist ids="' . implode(',', $settings->audios) . '"' . $playlist_settings . ']';
    ?>
	</div>

<?php 
} else {
    ?>
	<div class="fl-audio fl-wp-audio" itemscope itemtype="http://schema.org/AudioObject">
		<?php 
    $audio_data = $module->get_data();
    $loop = isset($settings->loop) && $settings->loop ? ' loop="yes"' : '';
    $autoplay = isset($settings->autoplay) && $settings->autoplay ? ' autoplay="yes"' : '';
    if ($settings->audio_type == 'media_library' && $audio_data) {
        $audio_url = $audio_data->url;
    } else {
        $audio_url = $settings->link;
    }
    echo '<meta itemprop="url" content="' . $audio_url . '" />';
    echo '[audio src="' . $audio_url . '"' . $autoplay . $loop . ']';
    ?>

	</div>	
<?php 
}
if (FLBuilderModel::is_builder_active()) {
    wp_underscore_playlist_templates();
}
开发者ID:nullality,项目名称:FEWD-SEA-7,代码行数:31,代码来源:frontend.php


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