Returns useful keys to use to lookup data from an attachment’s stored metadata.
Parameters
$attachment
WP_Postrequired- The current attachment, provided for context.
$context
stringoptional- The context. Accepts
'edit'
,'display'
. Default'display'
.Default:
'display'
Source
<div class="wp-playlist-current-item"></div>
<?php endif; ?>
<<?php echo $safe_type; ?> controls="controls" preload="none" width="<?php echo (int) $theme_width; ?>"
<?php
if ( 'video' === $safe_type ) {
echo ' height="', (int) $theme_height, '"';
}
?>
></<?php echo $safe_type; ?>>
<div class="wp-playlist-next"></div>
<div class="wp-playlist-prev"></div>
<noscript>
<ol>
<?php
foreach ( $attachments as $att_id => $attachment ) {
printf( '<li>%s</li>', wp_get_attachment_link( $att_id ) );
}
?>
</ol>
</noscript>
<script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode( $data ); ?></script>
</div>
<?php
return ob_get_clean();
}
add_shortcode( 'playlist', 'wp_playlist_shortcode' );
Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.