PHP Class WPSEO_OpenGraph, wordpress-seo

Datei anzeigen Open project: yoast/wordpress-seo Class Usage Examples

Public Properties

Property Type Description
$options array Options for the OpenGraph Settings

Public Methods

Method 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 method

Class constructor.
public __construct ( )

add_opengraph_namespace() public method

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

article_author_facebook() public method

Outputs the authors FB page.

category() public method

Output the article category as an article:section tag.
public category ( ) : boolean;
return boolean;

description() public method

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.
return string $ogdesc

facebook_filter() public method

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

image() public method

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 method

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

locale() public method

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.
return string $locale

og_tag() public method

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.
return boolean

og_title() public method

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

opengraph() public method

Main OpenGraph output.
public opengraph ( )

publish_date() public method

Output the article publish and last modification date
public publish_date ( ) : boolean;
return boolean;

site_name() public method

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

site_owner() public method

Outputs the site owner
public site_owner ( ) : boolean
return boolean

tags() public method

Output the article tags as article:tag tags.
public tags ( ) : boolean
return boolean

type() public method

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

url() public method

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

Property Details

$options public_oe property

Options for the OpenGraph Settings
public array $options
return array