"; $output .= "<{$heading} class='post-title entry-title' ".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).">"; $output .= " ".$current_post['title']; $output .= " "; $output .= " "; $output .= "{$heading}>"; $current_post['title'] = $output; } return $current_post; } } /** * The avia_audio_content_filter checks if a audio embed is provided and extracts it * If no slideshow is set, it checks if the content holds a video url, removes it and uses it for the slideshow * The filter also sets the height of the slideshow to fullsize, and even on overview posts all slides are displayed */ if(!function_exists('avia_audio_content_filter')) { function avia_audio_content_filter($current_post) { preg_match("!\[audio.+?\]\[\/audio\]!", $current_post['content'], $match_audio); if(!empty($match_audio)) { $current_post['before_content'] = do_shortcode($match_audio[0]); $current_post['content'] = str_replace($match_audio[0], "", $current_post['content']); } return avia_default_title_filter($current_post); } } /** * The avia_gallery_slideshow_filter checks if a gallery is set for an entry with post type gallery * and extracts the gallery, then displays it at the top of the entry * * The filter also sets the height of the slideshow to fullsize, and even on overview posts all slides are displayed */ if(!function_exists('avia_gallery_slideshow_filter')) { function avia_gallery_slideshow_filter($current_post) { //search for the first av gallery or gallery shortcode preg_match("!\[(?:av_)?gallery.+?\]!", $current_post['content'], $match_gallery); if(!empty($match_gallery)) { $gallery = $match_gallery[0]; if(strpos($gallery, 'av_') === false) $gallery = str_replace("gallery", 'av_gallery', $gallery); if(strpos($gallery, 'style') === false) $gallery = str_replace("]", " style='big_thumb' preview_size='gallery']", $gallery); $current_post['before_content'] = do_shortcode($gallery); $current_post['content'] = str_replace($match_gallery[0], "", $current_post['content']); $current_post['slider'] = ""; } return avia_default_title_filter($current_post); } } /** * The avia_video_slideshow_filter checks if a video slideshow is set for an entry with post type gallery * If no slideshow is set, it checks if the content holds a video url, removes it and uses it for the slideshow * The filter also sets the height of the slideshow to fullsize, and even on overview posts all slides are displayed */ if(!function_exists('avia_video_slideshow_filter')) { function avia_video_slideshow_filter($current_post) { //replace empty url strings with an embed code $current_post['content'] = preg_replace( '|^\s*(https?://[^\s"]+)\s*$|im', "[embed]$1[/embed]", $current_post['content'] ); //extrect embed and av_video codes from the content. if any were found execute them and prepend them to the post preg_match("!\[embed.+?\]|\[av_video.+?\]!", $current_post['content'], $match_video); if(!empty($match_video)) { global $wp_embed; $video = $match_video[0]; $current_post['before_content'] = do_shortcode($wp_embed->run_shortcode($video)); $current_post['content'] = str_replace($match_video[0], "", $current_post['content']); $current_post['slider'] = ""; } return avia_default_title_filter($current_post); } } /** * The avia_image_slideshow_filter checks if an image is set for an entry with post type image * If no image is set, it checks if the content holds an image, removes it and uses it for the slideshow * The filter also sets the height of the slideshow to fullsize, and even on overview posts all slides are displayed */ if(!function_exists('avia_image_slideshow_filter')) { function avia_image_slideshow_filter($current_post) { $prepend_image = get_the_post_thumbnail(get_the_ID(), 'large'); $image = ""; if(!$prepend_image) { $image = avia_regex($current_post['content'],'image'); if(is_array($image)) { $image = $image[0]; $prepend_image = '
".$current_post['title']."
'entry_title','echo'=>false)).">".$current_post['title'].""; } return $current_post; } }