我可以在wp安装的源代码中看到这些代码:
<!-- jQuery -->
<script type="text/html" id="tmpl-wp-playlist-current-item">
<# if ( data.image ) { #>
<img src="{{ data.thumb.src }}" alt="" />
<# } #>
<div class="wp-playlist-caption">
<span class="wp-playlist-item-meta wp-playlist-item-title">“{{ data.title }}”</span>
<# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #>
<# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #>
</div>
</script>
<script type="text/html" id="tmpl-wp-playlist-item">
<div class="wp-playlist-item">
<a class="wp-playlist-caption" href="{{ data.src }}">
{{ data.index ? ( data.index + \'. \' ) : \'\' }}
<# if ( data.caption ) { #>
{{ data.caption }}
<# } else { #>
<span class="wp-playlist-item-title">“{{{ data.title }}}”</span>
<# if ( data.artists && data.meta.artist ) { #>
<span class="wp-playlist-item-artist"> — {{ data.meta.artist }}</span>
<# } #>
<# } #>
</a>
<# if ( data.meta.length_formatted ) { #>
<div class="wp-playlist-item-length">{{ data.meta.length_formatted }}</div>
<# } #>
</div>
</script>
我试图退出队列,但它并没有停止加载。我补充道:
function my_dequeue_script() {
wp_dequeue_script( \'mediaelement\' );
wp_dequeue_script( \'wp-mediaelement\' );
wp_dequeue_script( \'wp-playlist\' );
wp_dequeue_script( \'wp-embed\' );
}
add_action( \'wp_print_scripts\', \'my_dequeue_script\', 100 );
以及
function my_deregister_scripts(){
wp_dequeue_script( \'mediaelement\' );
wp_dequeue_script( \'wp-mediaelement\' );
wp_dequeue_script( \'wp-playlist\' );
wp_deregister_script( \'wp-embed\' );
}
add_action( \'wp_footer\', \'my_deregister_scripts\' );
它们都没有删除脚本。此外,我想删除那些代码片段,我想它们是用于音频的,我不打算使用它,所以如何删除使用这些函数的代码片段。php?如果我不使用音频文件,删除这些文件有什么意义?