src/includes/classes/Core/Utils/OEmbed.php
protected function embedlyMarkup(string $url, \StdClass $embed): string
    {
        $markup = ''; // Initialize HTML markup.

        if (!$url || empty($embed->type) || empty($embed->provider_name)) {
            return $markup; // Not possible; i.e., empty string.
        }
        $provider_slug = $this->c::nameToSlug($embed->provider_name);
        $classes       = '_-embedly _-'.$embed->type.' _-'.$provider_slug;

        switch ($embed->type) { // See: <http://jas.xyz/1O7ymwT>
            case 'rich':
            case 'video':
                if (!empty($embed->html)) {
                    $markup = '<div class="'.$this->c::escAttr($classes).'">'.
                        $embed->html.
                    '</div>';
                }
                break;

            case 'photo':
                if (!empty($embed->url) && isset($embed->width, $embed->height)) {
                    $markup = '<div class="'.$this->c::escAttr($classes).'">'.
                        '<a href="'.$this->c::escUrl($url).'" title="'.$this->c::escAttr($embed->title ?? '').'">'.
                            '<img src="'.$this->c::escUrl($embed->url).'" width="'.$this->c::escAttr((string) $embed->width).'" height="'.$this->c::escAttr((string) $embed->height).'" alt="" />'.
                        '</a>'.
                    '</div>';
                }
                break;

            case 'link':
                if (!empty($embed->thumbnail_url) && isset($embed->thumbnail_width, $embed->thumbnail_height)) {
                    $markup = '<div class="'.$this->c::escAttr($classes).'">'.
                        '<a href="'.$this->c::escUrl($url).'" title="'.$this->c::escAttr($embed->title ?? '').'">'.
                            '<img src="'.$this->c::escUrl($embed->thumbnail_url).'" width="'.$this->c::escAttr((string) $embed->thumbnail_width).'" height="'.$this->c::escAttr((string) $embed->thumbnail_height).'" alt="" />'.
                        '</a>'.
                    '</div>';
                }
                break;
        }
        return $markup;
    }
protected function embedlyMarkup(string $url, \StdClass $embed): string
    {
        $markup = ''; // Initialize HTML markup.

        if (!$url || empty($embed->type) || empty($embed->provider_name)) {
            return $markup; // Not possible; i.e., empty string.
        }
        $provider_slug = $this->c::nameToSlug($embed->provider_name);
        $classes       = '_-embedly _-'.$embed->type.' _-'.$provider_slug;

        switch ($embed->type) { // See: <http://jas.xyz/1O7ymwT>
            case 'rich':
            case 'video':
                if (!empty($embed->html)) {
                    $markup = '<div class="'.$this->c::escAttr($classes).'">'.
                        $embed->html.
                    '</div>';
                }
                break;

            case 'photo':
                if (!empty($embed->url) && isset($embed->width, $embed->height)) {
                    $markup = '<div class="'.$this->c::escAttr($classes).'">'.
                        '<a href="'.$this->c::escUrl($url).'" title="'.$this->c::escAttr($embed->title ?? '').'">'.
                            '<img src="'.$this->c::escUrl($embed->url).'" width="'.$this->c::escAttr((string) $embed->width).'" height="'.$this->c::escAttr((string) $embed->height).'" alt="" />'.
                        '</a>'.
                    '</div>';
                }
                break;

            case 'link':
                if (!empty($embed->thumbnail_url) && isset($embed->thumbnail_width, $embed->thumbnail_height)) {
                    $markup = '<div class="'.$this->c::escAttr($classes).'">'.
                        '<a href="'.$this->c::escUrl($url).'" title="'.$this->c::escAttr($embed->title ?? '').'">'.
                            '<img src="'.$this->c::escUrl($embed->thumbnail_url).'" width="'.$this->c::escAttr((string) $embed->thumbnail_width).'" height="'.$this->c::escAttr((string) $embed->thumbnail_height).'" alt="" />'.
                        '</a>'.
                    '</div>';
                }
                break;
        }
        return $markup;
    }
Get Embedly markup.

@since 151125 OEmbed utilities.

@param string    $url   URL the embed is for.
@param \StdClass $embed The embed response object.

@return string The Embedly HTML markup.