Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

embedding links from metadata

This discussion is related to the OEmbed addon.
edited November 2015 in Vanilla 2.0 - 2.3


This plugin is creating embeddable content for all links. Not just the ones in the user posts.

This includes, any links in the og metadata
These are located between the <head> tags of the page.

The causes (I suspect) are specifically these tags:

<meta property="og:description" content="look:">
<meta name="description" property="og:description" itemprop="description" content="look:">

The obvious solution would be to only search for URLs in the <body> tag (or a particualy set of divs).

However my programming knowledge is limited, and vanilla documentation is somewhat sparse.
Any help/tips will be appreciated.

The code i have to modify is probably here (class.oembed.plugin.php):

    public function base_links_handler($sender, $args)
        $self = $this;

        $mixed =& $args['Mixed'];

        // Include Composer autoloader
        $this->getResource('library/vendors/autoload.php', true);

        // Get instance of Essence library
        $essence = \Essence\Essence::instance();

        // Replace links with embedable HTML
        $mixed = $essence->replace($mixed, function($media) use ($self) {
            $slug = str_replace(' ', '', ucwords($media->providerName));

            $media->set('providerSlug', $slug);

            include $self->getView($media->type.'.php');



Sign In or Register to comment.