([^<]+)<\/a>/i"; if ( $text != '') preg_match_all( $pattern, $text, $result ); elseif ( is_attachment() ) preg_match_all( $pattern, wp_get_attachment_link( $post->ID ), $result ); else preg_match_all( $pattern, $post->post_content, $result ); foreach ($result[0] as $key => $value) { echo do_shortcode('[audio src="' . $result[3][$key] . '"]'); } } } new Boozurk_Audio_Player;