core/TagParser.php
private function processText($text)
    {
        // verify if content is a string otherwhise just return the original provided content
        if (!is_string($text) || empty($text)) {
            return $text;
        }
        // find all tags based on the REGEX expression
        preg_match_all(static::REGEX, $text, $results, PREG_SET_ORDER);
        // foreach all the results matches the regex
        foreach ($results as $row) {
            // When value is empty (can be caused by using `link[]` we have to skip this item.
            if (empty($row['value'])) {
                continue;
            }
            // extract tag name from regex
            $tag = $row['function'];
            if ($this->hasTag($tag)) {
                $replace = $this->parseTag($tag, $row);
                $text = preg_replace('/'.preg_quote($row[0], '/').'/mi', $replace, $text, 1);
            }
        }
        
        return $text;
    }
private function processText($text)
    {
        // verify if content is a string otherwhise just return the original provided content
        if (!is_string($text) || empty($text)) {
            return $text;
        }
        // find all tags based on the REGEX expression
        preg_match_all(static::REGEX, $text, $results, PREG_SET_ORDER);
        // foreach all the results matches the regex
        foreach ($results as $row) {
            // When value is empty (can be caused by using `link[]` we have to skip this item.
            if (empty($row['value'])) {
                continue;
            }
            // extract tag name from regex
            $tag = $row['function'];
            if ($this->hasTag($tag)) {
                $replace = $this->parseTag($tag, $row);
                $text = preg_replace('/'.preg_quote($row[0], '/').'/mi', $replace, $text, 1);
            }
        }
        
        return $text;
    }
private function processText ( $ text ) { // verify if content is a string otherwhise just return the original provided content if ( ! is_string ( $ text ) || empty ( $ text ) ) { return $ text ; } // find all tags based on the REGEX expression preg_match_all ( static :: REGEX , $ text , $ results , PREG_SET_ORDER ) ; // foreach all the results matches the regex foreach ( $ results as $ row ) { // When value is empty (can be caused by using `link[]` we have to skip this item. if ( empty ( $ row [ 'value' ] ) ) { continue ; } // extract tag name from regex $ tag = $ row [ 'function' ] ; if ( $ this -> hasTag ( $ tag ) ) { $ replace = $ this -> parseTag ( $ tag , $ row ) ; $ text = preg_replace ( '/' . preg_quote ( $ row [ 0 ] , '/' ) . '/mi' , $ replace , $ text , 1 ) ; } } return $ text ; }
Process a given text.

+ This will find all tag based expressions inside the text
+ instantiate the tag if the alias exists.
+ parse the tag and modify the input $text

@param string $text The input text
@return string The parsed text
Process a given text .