Strip Shortcode function not working? (1 post)

  1. WindyCityDigital
    Posted 1 year ago #

    I've built a custom word count script that is supposed to return the Word Count of the post. I'm trying to get it to remove shortcodes, but when I add the strip_shortcodes function, it removes everything between the shortcodes and not just the shortcodes themselves. Below is my script:

    function ic_word_count() {
        global $post;
        return str_word_count( strip_tags( strip_shortcodes( $post->post_content ) ) );

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by WindyCityDigital
  • This topic is not resolved
  • WordPress version: 3.8.1