public static function escape($text)
    {
        $tagregexp = implode('|', array_map('preg_quote', static::_list()));
        preg_match_all('/(.?){(' . $tagregexp . ')\b(.*?)(?:(\/))?}(?:(.+?){\/\2})?(.?)/s', $text, $matches);

        foreach ($matches[0] as $ht) {
            $replace = str_replace_once('{', '{{', $ht);
            $replace = str_replace_last('}', '}}', $replace);
            $text = str_replace($ht, $replace, $text);
        }

        return $text;
    }
public static function escape($text)
    {
        $tagregexp = implode('|', array_map('preg_quote', static::_list()));
        preg_match_all('/(.?){(' . $tagregexp . ')\b(.*?)(?:(\/))?}(?:(.+?){\/\2})?(.?)/s', $text, $matches);

        foreach ($matches[0] as $ht) {
            $replace = str_replace_once('{', '{{', $ht);
            $replace = str_replace_last('}', '}}', $replace);
            $text = str_replace($ht, $replace, $text);
        }

        return $text;
    }
public static function escape ( $ text ) { $ tagregexp = implode ( '|' , array_map ( 'preg_quote' , static :: _list ( ) ) ) ; preg_match_all ( '/(.?){(' . $ tagregexp . ')\b(.*?)(?:(\/))?}(?:(.+?){\/\2})?(.?)/s' , $ text , $ matches ) ; foreach ( $ matches [ 0 ] as $ ht ) { $ replace = str_replace_once ( '{' , '{{' , $ ht ) ; $ replace = str_replace_last ( '}' , '}}' , $ replace ) ; $ text = str_replace ( $ ht , $ replace , $ text ) ; } return $ text ; }
Escapes all shortcodes from the given content.

@param string $text Text from which to escape shortcodes
@return string Content with all shortcodes escaped
Escapes all shortcodes from the given content .