From 12de05107e4c8b006bde6ee8916f34eb476d08da Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 13 Jun 2008 17:21:00 +0000 Subject: WP Merge with revision 8075 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/shortcodes.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'wp-includes/shortcodes.php') diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 907f7ff..490f7a6 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -134,6 +134,23 @@ function shortcode_atts($pairs, $atts) { return $out; } +/* + * stip all the shortcodes from a post's content + * returns the content without shortcodes + */ +function strip_shortcodes( $content ) { + + global $shortcode_tags; + + if (empty($shortcode_tags) || !is_array($shortcode_tags)) + return $content; + + $pattern = get_shortcode_regex(); + + return preg_replace('/'.$pattern.'/s', '', $content); + +} + add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() ?> -- cgit