PHP Класс WPSEO_OpenGraph, wordpress-seo

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$options array Options for the OpenGraph Settings

Открытые методы

Метод Описание
__construct ( ) Class constructor.
add_opengraph_namespace ( string $input ) : string Filter for the namespace, adding the OpenGraph namespace.
article_author_facebook ( ) : boolean Outputs the authors FB page.
category ( ) : boolean; Output the article category as an article:section tag.
description ( boolean $echo = true ) : string Output the OpenGraph description, specific OG description first, if not, grab the meta description.
facebook_filter ( array $meta_tags ) : array Filter the Facebook plugins metadata
image ( string | boolean $image = false ) Create new WPSEO_OpenGraph_Image class and get the images to set the og:image
image_output ( string $image ) Fallback method for plugins using image_output
locale ( boolean $echo = true ) : string Output the locale, doing some conversions to make sure the proper Facebook locale is outputted.
og_tag ( string $property, string $content ) : boolean Internal function to output FB tags. This also adds an output filter to each bit of output based on the property.
og_title ( boolean $echo = true ) : string | boolean Outputs the SEO title as OpenGraph title.
opengraph ( ) Main OpenGraph output.
publish_date ( ) : boolean; Output the article publish and last modification date
site_name ( ) Output the site name straight from the blog info.
site_owner ( ) : boolean Outputs the site owner
tags ( ) : boolean Output the article tags as article:tag tags.
type ( boolean $echo = true ) : string Output the OpenGraph type.
url ( ) : boolean Outputs the canonical URL as OpenGraph URL, which consolidates likes and shares.
website_facebook ( ) : boolean Outputs the websites FB page.

Описание методов

__construct() публичный Метод

Class constructor.
public __construct ( )

add_opengraph_namespace() публичный Метод

Filter for the namespace, adding the OpenGraph namespace.
public add_opengraph_namespace ( string $input ) : string
$input string The input namespace string.
Результат string

article_author_facebook() публичный Метод

Outputs the authors FB page.
public article_author_facebook ( ) : boolean
Результат boolean

category() публичный Метод

Output the article category as an article:section tag.
public category ( ) : boolean;
Результат boolean;

description() публичный Метод

Output the OpenGraph description, specific OG description first, if not, grab the meta description.
public description ( boolean $echo = true ) : string
$echo boolean Whether to echo or return the description.
Результат string $ogdesc

facebook_filter() публичный Метод

Filter the Facebook plugins metadata
public facebook_filter ( array $meta_tags ) : array
$meta_tags array the array to fix.
Результат array $meta_tags

image() публичный Метод

Create new WPSEO_OpenGraph_Image class and get the images to set the og:image
public image ( string | boolean $image = false )
$image string | boolean Optional image URL.

image_output() публичный Метод

Fallback method for plugins using image_output
public image_output ( string $image )
$image string Image URL.

locale() публичный Метод

Last update/compare with FB list done on 2015-03-16 by Rarst
См. также: http://www.facebook.com/translations/FacebookLocales.xml for the list of supported locales
public locale ( boolean $echo = true ) : string
$echo boolean Whether to echo or return the locale.
Результат string $locale

og_tag() публичный Метод

Internal function to output FB tags. This also adds an output filter to each bit of output based on the property.
public og_tag ( string $property, string $content ) : boolean
$property string Property attribute value.
$content string Content attribute value.
Результат boolean

og_title() публичный Метод

Outputs the SEO title as OpenGraph title.
public og_title ( boolean $echo = true ) : string | boolean
$echo boolean Whether or not to echo the output.
Результат string | boolean

opengraph() публичный Метод

Main OpenGraph output.
public opengraph ( )

publish_date() публичный Метод

Output the article publish and last modification date
public publish_date ( ) : boolean;
Результат boolean;

site_name() публичный Метод

Output the site name straight from the blog info.
public site_name ( )

site_owner() публичный Метод

Outputs the site owner
public site_owner ( ) : boolean
Результат boolean

tags() публичный Метод

Output the article tags as article:tag tags.
public tags ( ) : boolean
Результат boolean

type() публичный Метод

Output the OpenGraph type.
public type ( boolean $echo = true ) : string
$echo boolean Whether to echo or return the type.
Результат string $type

url() публичный Метод

Outputs the canonical URL as OpenGraph URL, which consolidates likes and shares.
public url ( ) : boolean
Результат boolean

website_facebook() публичный Метод

Outputs the websites FB page.
public website_facebook ( ) : boolean
Результат boolean

Описание свойств

$options публичное свойство

Options for the OpenGraph Settings
public array $options
Результат array