Media: add a class to the <script> tag for the JSON encoded playlist data so it can be easily selected in WPPlaylistView. Props SergeyBiryukov, fixes #29383

git-svn-id: https://develop.svn.wordpress.org/trunk@29660 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-09-01 19:54:44 +00:00
parent e12d2db484
commit 4e846f9af7
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
initialize : function (options) {
this.index = 0;
this.settings = {};
this.data = options.metadata || $.parseJSON( this.$('script').html() );
this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() );
this.playerNode = this.$( this.data.type );
this.tracks = new Backbone.Collection( this.data.tracks );

View File

@ -1399,7 +1399,7 @@ function wp_playlist_shortcode( $attr ) {
}
?></ol>
</noscript>
<script type="application/json"><?php echo json_encode( $data ) ?></script>
<script type="application/json" class="wp-playlist-script"><?php echo json_encode( $data ) ?></script>
</div>
<?php
return ob_get_clean();