PHP Class WPSEO_OpenGraph, wordpress-seo

Afficher le fichier Open project: yoast/wordpress-seo Class Usage Examples

Méthodes publiques

Свойство Type Description
$options array Options for the OpenGraph Settings

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

Class constructor.
public __construct ( )

add_opengraph_namespace() public méthode

Filter for the namespace, adding the OpenGraph namespace.
public add_opengraph_namespace ( string $input ) : string
$input string The input namespace string.
Résultat string

article_author_facebook() public méthode

Outputs the authors FB page.
public article_author_facebook ( ) : boolean
Résultat boolean

category() public méthode

Output the article category as an article:section tag.
public category ( ) : boolean;
Résultat boolean;

description() public méthode

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.
Résultat string $ogdesc

facebook_filter() public méthode

Filter the Facebook plugins metadata
public facebook_filter ( array $meta_tags ) : array
$meta_tags array the array to fix.
Résultat array $meta_tags

image() public méthode

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() public méthode

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

locale() public méthode

Last update/compare with FB list done on 2015-03-16 by Rarst
See also: 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.
Résultat string $locale

og_tag() public méthode

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.
Résultat boolean

og_title() public méthode

Outputs the SEO title as OpenGraph title.
public og_title ( boolean $echo = true ) : string | boolean
$echo boolean Whether or not to echo the output.
Résultat string | boolean

opengraph() public méthode

Main OpenGraph output.
public opengraph ( )

publish_date() public méthode

Output the article publish and last modification date
public publish_date ( ) : boolean;
Résultat boolean;

site_name() public méthode

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

site_owner() public méthode

Outputs the site owner
public site_owner ( ) : boolean
Résultat boolean

tags() public méthode

Output the article tags as article:tag tags.
public tags ( ) : boolean
Résultat boolean

type() public méthode

Output the OpenGraph type.
public type ( boolean $echo = true ) : string
$echo boolean Whether to echo or return the type.
Résultat string $type

url() public méthode

Outputs the canonical URL as OpenGraph URL, which consolidates likes and shares.
public url ( ) : boolean
Résultat boolean

Property Details

$options public_oe property

Options for the OpenGraph Settings
public array $options
Résultat array