Builds the Playlist shortcode output.


wp_playlist_shortcode( array $attr )


This implements the functionality of the playlist shortcode for displaying a collection of WordPress audio or video files in a post.



(array) (Required) Array of default playlist attributes.

  • 'type'
    (string) Type of playlist to display. Accepts 'audio' or 'video'. Default 'audio'.
  • 'order'
    (string) Designates ascending or descending order of items in the playlist. Accepts 'ASC', 'DESC'. Default 'ASC'.
  • 'orderby'
    (string) Any column, or columns, to sort the playlist. If $ids are passed, this defaults to the order of the $ids array ('post__in'). Otherwise default is 'menu_order ID'.
  • 'id'
    (int) If an explicit $ids array is not present, this parameter will determine which attachments are used for the playlist. Default is the current post ID.
  • 'ids'
    (array) Create a playlist out of these explicit attachment IDs. If empty, a playlist will be created from all $type attachments of $id. Default empty.
  • 'exclude'
    (array) List of specific attachment IDs to exclude from the playlist. Default empty.
  • 'style'
    (string) Playlist style to use. Accepts 'light' or 'dark'. Default 'light'.
  • 'tracklist'
    (bool) Whether to show or hide the playlist. Default true.
  • 'tracknumbers'
    (bool) Whether to show or hide the numbers next to entries in the playlist. Default true.
  • 'images'
    (bool) Show or hide the video or audio thumbnail (Featured Image/post thumbnail). Default true.
  • 'artists'
    (bool) Whether to show or hide artist name in the playlist. Default true.


(string) Playlist output. Empty string if the passed type is unsupported.


File: wp-includes/media.php



Version Description
3.9.0 Introduced.
Scroll to Top