From: Laury GvR Date: Mon, 28 Sep 2015 17:00:21 +0000 (-0400) Subject: Remove page content from memberdb detail pages. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=312815ea2599357cab2efc15d6d0ff37fa543380;p=WP-Themes%2Fglmthemes%2Fmountpleasant-theme.git Remove page content from memberdb detail pages. --- diff --git a/functions.php b/functions.php index f8861f9..bf3fdf6 100644 --- a/functions.php +++ b/functions.php @@ -419,5 +419,23 @@ function mytheme_search_loop() { add_action('thematic_searchloop', 'mytheme_search_loop'); // End of the Contextual/Highlight Search functions +function custom_content($content) { + global $post; + if ($_GET['glm_action'] == "detail" ) { + if ( preg_match_all( '/'. get_shortcode_regex() .'/s', $post->post_content, $matches ) + && array_key_exists( 2, $matches ) + && in_array( 'glm-members-list', $matches[2] ) ) + { + $shortcode = $matches[0][0]; + $content = do_shortcode($shortcode); + return $content; + } else { + $content=str_replace($matches[0],"",$content); + return $content; + } + } + return $content; +} +add_filter('the_content', 'custom_content'); ?>