src/shortcodes/ShortcodeParser.php
public function hasShortcode($content, $tag)
    {
        if (false === strpos($content, '[')) {
            return false;
        }

        if ($this->existsShortcode($tag)) {
            return true;
        }

        preg_match_all($this->shortcodeRegex(), $content, $matches, PREG_SET_ORDER);

        if (empty($matches)) {
            return false;
        }

        foreach ($matches as $shortcode) {
            if ($tag === $shortcode[2]) {
                return true;
            }
        }

        return false;
    }
public function hasShortcode($content, $tag)
    {
        if (false === strpos($content, '[')) {
            return false;
        }

        if ($this->existsShortcode($tag)) {
            return true;
        }

        preg_match_all($this->shortcodeRegex(), $content, $matches, PREG_SET_ORDER);

        if (empty($matches)) {
            return false;
        }

        foreach ($matches as $shortcode) {
            if ($tag === $shortcode[2]) {
                return true;
            }
        }

        return false;
    }
public function hasShortcode ( $ content , $ tag ) { if ( false === strpos ( $ content , '[' ) ) { return false ; } if ( $ this -> existsShortcode ( $ tag ) ) { return true ; } preg_match_all ( $ this -> shortcodeRegex ( ) , $ content , $ matches , PREG_SET_ORDER ) ; if ( empty ( $ matches ) ) { return false ; } foreach ( $ matches as $ shortcode ) { if ( $ tag === $ shortcode [ 2 ] ) { return true ; } } return false ; }
Tests whether content has a particular shortcode
@param $content
@param $tag
@return bool
Tests whether content has a particular shortcode