我正在使用wp_playlist_shortcode()
输出音频播放列表。例如:
echo wp_playlist_shortcode( array(
\'ids\' => $track_ids
) );
多亏了回答中的想法142974, 我正在解开wp_underscore_playlist_templates()
函数并使用我自己的版本prefix_wp_underscore_playlist_templates()
因此,我可以自定义播放列表项目的输出。例如:add_action( \'wp_playlist_scripts\', function() {
remove_action( \'wp_footer\', \'wp_underscore_playlist_templates\', 0 );
add_action( \'wp_footer\', \'prefix_wp_underscore_playlist_templates\', 0 );
} );
现在我只是复制wp_underscore_playlist_templates()
到prefix_wp_underscore_playlist_templates()
.在我的自定义范围内prefix_wp_underscore_playlist_templates()
函数,adata
对象可用,但我相信它只包含与轨迹相关的“数据”,例如data.meta.artist
和data.content
.
My question
当我在里面的时候,我怎样才能得到赛道的帖子IDprefix_wp_underscore_playlist_templates()
?