PHP 클래스 The_SEO_Framework\Generate_Image

Generates Image SEO data based on content.
부터: 2.7.1
상속: extends Generate_Url
파일 보기 프로젝트 열기: sybrew/the-seo-framework

공개 프로퍼티들

프로퍼티 타입 설명
$image_dimensions array Holds the image dimensions, if found.

공개 메소드들

메소드 설명
get_header_image ( boolean $set_og_dimensions = false ) : string Returns header image URL.
get_image ( string $post_id = '', array $args = [], boolean $escape = true ) : string Fetches og:image URL.
get_image_from_post_thumbnail ( array $args = [] ) : string | null Fetches image from post thumbnail.
get_image_from_woocommerce_gallery ( ) : array Fetches images id's from WooCommerce gallery
parse_image_args ( array $args = [], array $defaults = [], boolean $get_defaults = false ) : array Parse and sanitize image args.
parse_og_image ( integer $id, array $args = [] ) : string | empty Parses OG image to correct size.
reparse_image_args ( array $args = [] ) : array Reparses image args.
site_icon ( string $size = 'full', boolean $set_og_dimensions = false ) : string Fetches site icon brought in WordPress 4.3.0

보호된 메소드들

메소드 설명
__construct ( ) Constructor, loads parent constructor.

메소드 상세

__construct() 보호된 메소드

Constructor, loads parent constructor.
protected __construct ( )

get_header_image() 공개 메소드

Also sets image dimensions. Falls back to current post ID for index.
부터: 2.7.0
public get_header_image ( boolean $set_og_dimensions = false ) : string
$set_og_dimensions boolean Whether to set size for OG image. Always falls back to the current post ID.
리턴 string The header image URL, not escaped.

get_image() 공개 메소드

Fetches og:image URL.
부터: 2.5.2 Applies filters string the_seo_framework_og_image_after_featured
부터: 2.5.2 Applies filters string the_seo_framework_og_image_after_header
public get_image ( string $post_id = '', array $args = [], boolean $escape = true ) : string
$post_id string The post ID.
$args array The image arguments.
$escape boolean Whether to escape the image URL.
리턴 string the image URL.

get_image_from_post_thumbnail() 공개 메소드

Resizes the image between 1500px if bigger. Then it saves the image and Keeps dimensions relative.
부터: 2.3.0
public get_image_from_post_thumbnail ( array $args = [] ) : string | null
$args array Image arguments.
리턴 string | null the image url.

parse_image_args() 공개 메소드

Parse and sanitize image args.
부터: 2.5.0
부터: 2.0.1 Applies filters the_seo_framework_og_image_args : { @param string $image The image url @param mixed $size The image size @param bool $icon Fetch Image icon @param array $attr Image attributes @param array $disallowed Disallowed image types : { array ( string 'featured' string 'header' string 'icon' ) } } The image set in the filter will always be used as fallback
public parse_image_args ( array $args = [], array $defaults = [], boolean $get_defaults = false ) : array
$args array required The passed arguments.
$defaults array The default arguments.
$get_defaults boolean Return the default arguments. Ignoring $args.
리턴 array $args parsed args.

parse_og_image() 공개 메소드

Parses OG image to correct size.
부터: 2.5.0
public parse_og_image ( integer $id, array $args = [] ) : string | empty
$id integer The attachment ID.
$args array The image args
리턴 string | empty Parsed image url or empty if already called

reparse_image_args() 공개 메소드

Reparses image args.
부터: 2.6.6
public reparse_image_args ( array $args = [] ) : array
$args array required The passed arguments.
리턴 array $args parsed args.

site_icon() 공개 메소드

Fetches site icon brought in WordPress 4.3.0
부터: 2.2.1
public site_icon ( string $size = 'full', boolean $set_og_dimensions = false ) : string
$size string The icon size, accepts 'full' and pixel values.
$set_og_dimensions boolean Whether to set size for OG image. Always falls back to the current post ID.
리턴 string URL site icon, not escaped.

프로퍼티 상세

$image_dimensions 공개적으로 프로퍼티

Holds the image dimensions, if found.
부터: 2.7.0
public array $image_dimensions
리턴 array