src/View/Helper/MetaHelper.php
public function opengraph($entity)
    {
        $attributes = [
            'og:locale' => Wasabi::contentLanguage()->lang,
            'og:type' => $entity->attributes['og:type'] ?? 'article',
            'og:title' => $this->_getTitle($entity),
            'og:description' => $entity->attributes['og:description'] ?? $entity->meta_description,
            'og:url' => Router::url(null, true),
            'og:site_name' => Configure::read('Settings.Cms.SEO.application-name')
        ];

        if ($entity->displayMetaDates) {
            $attributes['og:updated_time'] = $entity->modified->format('c');
        }

        $fbPageId = Configure::read('Settings.Cms.SEO.Social.facebook_page_id');
        if ($fbPageId !== null) {
            $attributes['fb:admins'] = $fbPageId;
        }

        $out = '';
        foreach ($attributes as $property => $content) {
            if ($property === 'og:title') {
                $out .= $this->_render(self::ATTR_PROP, $property, $content, self::ATTR_NAME, 'dcterms.title');
            } else {
                $out .= $this->_render(self::ATTR_PROP, $property, $content);
            }
        }

        return $out;
    }
public function opengraph($entity)
    {
        $attributes = [
            'og:locale' => Wasabi::contentLanguage()->lang,
            'og:type' => $entity->attributes['og:type'] ?? 'article',
            'og:title' => $this->_getTitle($entity),
            'og:description' => $entity->attributes['og:description'] ?? $entity->meta_description,
            'og:url' => Router::url(null, true),
            'og:site_name' => Configure::read('Settings.Cms.SEO.application-name')
        ];

        if ($entity->displayMetaDates) {
            $attributes['og:updated_time'] = $entity->modified->format('c');
        }

        $fbPageId = Configure::read('Settings.Cms.SEO.Social.facebook_page_id');
        if ($fbPageId !== null) {
            $attributes['fb:admins'] = $fbPageId;
        }

        $out = '';
        foreach ($attributes as $property => $content) {
            if ($property === 'og:title') {
                $out .= $this->_render(self::ATTR_PROP, $property, $content, self::ATTR_NAME, 'dcterms.title');
            } else {
                $out .= $this->_render(self::ATTR_PROP, $property, $content);
            }
        }

        return $out;
    }
public function opengraph ( $ entity ) { $ attributes = [ 'og:locale' => Wasabi :: contentLanguage ( ) -> lang , 'og:type' => $ entity -> attributes [ 'og:type' ] ?? 'article' , 'og:title' => $ this -> _getTitle ( $ entity ) , 'og:description' => $ entity -> attributes [ 'og:description' ] ?? $ entity -> meta_description , 'og:url' => Router :: url ( null , true ) , 'og:site_name' => Configure :: read ( 'Settings.Cms.SEO.application-name' ) ] ; if ( $ entity -> displayMetaDates ) { $ attributes [ 'og:updated_time' ] = $ entity -> modified -> format ( 'c' ) ; } $ fbPageId = Configure :: read ( 'Settings.Cms.SEO.Social.facebook_page_id' ) ; if ( $ fbPageId !== null ) { $ attributes [ 'fb:admins' ] = $ fbPageId ; } $ out = '' ; foreach ( $ attributes as $ property => $ content ) { if ( $ property === 'og:title' ) { $ out .= $ this -> _render ( self :: ATTR_PROP , $ property , $ content , self :: ATTR_NAME , 'dcterms.title' ) ; } else { $ out .= $ this -> _render ( self :: ATTR_PROP , $ property , $ content ) ; } } return $ out ; }
Render all og meta tags.

@param PublishableEntity $entity The entity, e.g. Page or Post.
@return string
Render all og meta tags .