setOption(array('encoding' => 'UTF-8')); $info = $getID3->analyze($file); $total = explode(':', $info['playtime_string']); $mins = $total[0]; $secs = $total[1]; unset($getID3, $total, $info); return array( 'PT' . $mins . 'M' . $secs . 'S', $mins . ' minutes, ' . $secs . ' seconds' ); } function audio_item_formatted($post) { global $root; $song = apply_filters('the_title', $post->post_title); $artist = $post->post_excerpt; $album = $post->post_content; $parts = parse_url($post->guid); $local_file = getcwd() . $parts['path']; ?>
ID); if (count($imgs)): foreach ($imgs as $img): $meta = wp_get_attachment_image_src($img->ID, array(A_THUMB_WIDTH, A_THUMB_HEIGHT), true); printf('%s', $meta[0], $meta[1], $meta[2], apply_filters('the_title_attribute', $song)); endforeach; endif; endif; ?> "%s"', A_SECURE ? base64_encode($parts['path']) : ($root . $parts['path']), $song); ?>
get_the_id(), 'post_mime_type' => 'audio', 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_status' => 'inherit', 'numberposts' => -1 )); endif; if (count($audio) > 0): ?>
'' ), $atts)); ob_start(); the_audio($layout); $audio = ob_get_contents(); ob_end_clean(); return $audio; } add_shortcode('audio', 'audio_handler'); ?>