wp_playlist_scripts

函式
wp_playlist_scripts ( $type )
引數
  • (string) $type Type of playlist. Accepts 'audio' or 'video'.
    Required:
定義位置
相關方法
wp_print_scriptswp_localize_scriptwp_default_scriptswp_playlist_shortcodewp_list_sort
引入
3.9.0
棄用
-

wp_playlist_scripts。這個動作用於在WordPress中排隊等候播放列表短碼所需的JavaScript和CSS: 當在文章或頁面上使用播放列表短碼時,它被觸發。

為播放列表輸出和排隊預設指令碼和樣式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_playlist_scripts( $type ) {
wp_enqueue_style( 'wp-mediaelement' );
wp_enqueue_script( 'wp-playlist' );
?>
<!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ); ?>');</script><![endif]-->
<?php
add_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 );
add_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 );
}
function wp_playlist_scripts( $type ) { wp_enqueue_style( 'wp-mediaelement' ); wp_enqueue_script( 'wp-playlist' ); ?> <!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ); ?>');</script><![endif]--> <?php add_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 ); add_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 ); }
function wp_playlist_scripts( $type ) {
	wp_enqueue_style( 'wp-mediaelement' );
	wp_enqueue_script( 'wp-playlist' );
	?>
<!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ); ?>');</script><![endif]-->
	<?php
	add_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 );
	add_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 );
}

常見問題

FAQs
檢視更多 >