Last active
December 21, 2017 00:25
-
-
Save bigdigital/bd9a915381ac4409b5ebd05c5a3289dc to your computer and use it in GitHub Desktop.
The7 remove VC from excerpts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_vc_from_excerpt( $excerpt ) { | |
$patterns = "/\[[\/]?vc_[^\]]*\]/"; | |
$replacements = ""; | |
return preg_replace($patterns, $replacements, $excerpt); | |
} | |
function custom_content($content) { | |
$content = get_the_content( '' ); | |
$content = remove_vc_from_excerpt( $content ); | |
$content = strip_shortcodes( $content ); | |
return $content; | |
} | |
add_filter( 'the_content', 'custom_content', 30); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment