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:
parent
e12d2db484
commit
4e846f9af7
|
@ -7,7 +7,7 @@
|
||||||
initialize : function (options) {
|
initialize : function (options) {
|
||||||
this.index = 0;
|
this.index = 0;
|
||||||
this.settings = {};
|
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.playerNode = this.$( this.data.type );
|
||||||
|
|
||||||
this.tracks = new Backbone.Collection( this.data.tracks );
|
this.tracks = new Backbone.Collection( this.data.tracks );
|
||||||
|
|
|
@ -1399,7 +1399,7 @@ function wp_playlist_shortcode( $attr ) {
|
||||||
}
|
}
|
||||||
?></ol>
|
?></ol>
|
||||||
</noscript>
|
</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>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
|
|
Loading…
Reference in New Issue