<?php // Exit if the file is accessed directly over web if (!defined('ABSPATH')) { exit; } ?> <div class="mpp-item-playlist mpp-audio-playlist mpp-u-1-1"> <?php do_action('mpp_before_media_playlist'); ?> <?php $ids = mpp_get_all_media_ids(); echo wp_playlist_shortcode(array('ids' => $ids)); ?> <?php do_action('mpp_after_media_playlist'); ?> </div>
// Exit if the file is accessed directly over web if (!defined('ABSPATH')) { exit; } /** * List videos attached to activity * */ ?> <div class=" mpp-activity-media-list mpp-activity-video-list mpp-activity-video-player"> <?php $ids = $media_ids; //is there only one video attached? if (count($ids) == 1) { $ids = array_pop($ids); $media = mpp_get_media($ids); $args = array('src' => mpp_get_media_src('', $media), 'poster' => mpp_get_media_src('thumbnail', $media)); //show single video with poster echo wp_video_shortcode($args); } else { //show all videos as playlist echo wp_playlist_shortcode(array('ids' => $ids, 'type' => 'video')); } ?> <script type='text/javascript'> mpp_mejs_activate(<?php echo bp_get_activity_id(); ?> ); </script> </div>
function replacePlaylistShortcode($attr, $content = '') { /* WP 4.0 [playlist] shortcode attributes: * --- * @type string $type Type of playlist to display. Accepts 'audio' or 'video'. Default 'audio'. * @type string $order Designates ascending or descending order of items in the playlist. * Accepts 'ASC', 'DESC', or 'RAND'. Default 'ASC'. * @type string $orderby 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'. * @type int $id 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. * @type array $ids Create a playlist out of these explicit attachment IDs. If empty, * a playlist will be created from all $type attachments of $id. * Default empty. * @type array $exclude List of specific attachment IDs to exclude from the playlist. Default empty. * @type string $style Playlist style to use. Accepts 'light' or 'dark'. Default 'light'. * @type bool $tracklist Whether to show or hide the playlist. Default true. * @type bool $tracknumbers Whether to show or hide the numbers next to entries in the playlist. Default true. * @type bool $images Show or hide the video or audio thumbnail (Featured Image/post * thumbnail). Default true. * @type bool $artists Whether to show or hide artist name in the playlist. Default true. */ if (isset($attr['type']) && 'video' === $attr['type']) { $output = $content; if (function_exists('wp_playlist_shortcode')) { $output = wp_playlist_shortcode($attr); } return $output; } //alias the params if (!isset($attr['list'])) { $attr['list'] = isset($attr['tracklist']) && $attr['tracklist'] === 'false' ? 'n' : 'y'; } if (!isset($attr['captions'])) { $attr['captions'] = isset($attr['artists']) && $attr['artists'] === 'false' ? false : ''; } $attr['images'] = !isset($attr['images']) ? 'true' : $attr['images']; $attr['text'] = !empty($attr['title']) && empty($attr['text']) ? $attr['title'] : (empty($attr['text']) ? '' : $attr['text']); //popout link text //process it $ops = $this->theSettings; return $ops['replacerShortcode_playlist'] === 'player' ? $this->primary_player($attr, $content) : $this->popout_link_player($attr, $content); }