PHP Class WPSEO_OpenGraph_Image, wordpress-seo

ファイルを表示 Open project: yoast/wordpress-seo Class Usage Examples

Protected Properties

Property Type Description
$dimensions array Holds image dimensions, if determined.

Public Methods

Method Description
__construct ( array $options, string | boolean $image = false ) Constructor
get_dimensions ( ) : array Return the dimensions array.
get_images ( ) : array Return the images array

Private Methods

Method Description
add_image ( string $img ) : boolean Display an OpenGraph image tag
check_featured_image_size ( array $img_data ) : boolean Check size of featured image. If image is too small, return false, else return true
get_attachment_page_image ( integer $post_id ) : boolean If this is an attachment page, call add_image with the attachment and return true
get_content_images ( object $post ) Filter: 'wpseo_pre_analysis_post_content' - Allow filtering the content before analysis
get_default_image ( ) Get default image and call add_image
get_featured_image ( integer $post_id ) : boolean If there is a featured image, check image size. If image size is correct, call add_image and return true
get_front_page_image ( ) If the frontpage image exists, call add_image
get_opengraph_image_post ( integer $post_id ) : boolean If opengraph-image is set, call add_image and return true.
get_opengraph_image_taxonomy ( ) Check if taxonomy has an image and add this image
get_posts_page_image ( ) Get the images of the posts page.
get_relative_path ( array $img ) : boolean | string Get the relative path of the image
get_singular_image ( ) Get the images of the singular post.
set_images ( ) Check if page is front page or singular and call the corresponding functions. If not, call get_default_image.

Method Details

__construct() public method

Constructor
public __construct ( array $options, string | boolean $image = false )
$options array Options set.
$image string | boolean Optional image URL.

get_dimensions() public method

Return the dimensions array.
public get_dimensions ( ) : array
return array

get_images() public method

Return the images array
public get_images ( ) : array
return array

Property Details

$dimensions protected_oe property

Holds image dimensions, if determined.
protected array $dimensions
return array