]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $content, $match_link)) { // Define title URL as being the extracted URL // $content['title_href'] = $link[0]; // Remove link from content $content = str_replace($match_link[0], "", $content); } $return = array( 'content' => self::esc($content), 'link' => isset($match_link[0]) ? $match_link[0] : esc_url(get_permalink()), ); return $return; } public static function image($img_class = '') { if (has_post_thumbnail()) { ?> get_the_title(), 'class' => $img_class) ); ?> '. do_shortcode($wp_embed->run_shortcode($match_video[0])) . ''; // Removes video from content $content = str_replace($match_video[0], "", $content); } return self::esc($content); } public static function audio($content = '') { if(empty($content)) { $content = get_the_content(); } // Wraps audio URLs in [embed] tags $content = preg_replace('|^\s*(https?://[^\s"]+)\s*$|im', "[embed]$1[/embed]", get_the_content('')); // Find a [embed] or [audio] shortcode in the content and extract it. If found a audio inside content, take the first and extract if (preg_match("!\[embed.+?\]|\[audio.+?\](?:\[\/audio\])?|\[playlist.+?\]!", $content, $match_audio)) { global $wp_embed; // Display audio echo '