Twitter\WordPress\Shortcodes\Follow::linkHandler PHP Method

linkHandler() public static method

Handle a URL matched by a embed handler
Since: 1.3.1
public static linkHandler ( array $matches, array $attr, string $url, array $rawattr ) : string
$matches array The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
$attr array Embed attributes. Not used.
$url string The original URL that was matched by the regex. Not used.
$rawattr array The original unmodified attributes. Not used.
return string HTML markup for the follow button or an empty string if requirements not met
    public static function linkHandler($matches, $attr, $url, $rawattr)
    {
        if (!(is_array($matches) && isset($matches[1]) && $matches[1])) {
            return '';
        }
        return static::shortcodeHandler(array('screen_name' => $matches[1]));
    }