프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$extensions | Allowed extensions must match http://code.trac.wordpress.org/browser/photon/index.php#L31 | ||
$image_sizes | Don't access this directly. Instead, use self::image_sizes() so it's actually populated with something. |
메소드 | 설명 | |
---|---|---|
action_wp_enqueue_scripts ( ) : null | Enqueue Photon helper script | |
filter_image_downsize ( string | boolean $image, integer $attachment_id, string | array $size ) : string | boolean | Filter post thumbnail image retrieval, passing images through Photon | |
filter_open_graph_tags ( array $tags, array $parameters ) : array | Pass og:image URLs through Photon | |
filter_sizes ( array $sizes, array $size ) : array | Filters an array of image sizes values, using $content_width instead of image's full size. | |
filter_srcset_array ( array $sources, $size_array, $image_src, $image_meta ) : array | Filters an array of image srcset values, replacing each URL with its Photon equivalent. | |
filter_the_content ( string $content ) : string | Identify images in post content, and if images are local (uploaded to the current site), pass through Photon. | |
filter_the_galleries ( $galleries ) | ||
instance ( ) : object | Singleton implementation | |
parse_dimensions_from_filename ( string $src ) : array | Try to determine height and width from strings WP appends to resized image filenames. | |
parse_images_from_html ( string $content ) : array | Match all images and any relevant tags in a block of HTML. |
메소드 | 설명 | |
---|---|---|
image_sizes ( ) : array | Provide an array of available image sizes and corresponding dimensions. | |
strip_image_dimensions_maybe ( string $src ) : string | Checks if the file exists before it passes the file to photon | |
validate_image_url ( string $url ) : boolean | Ensure image URL is valid for Photon. |
메소드 | 설명 | |
---|---|---|
__construct ( ) | Silence is golden. | |
setup ( ) : null | Register actions and filters, but only if basic Photon functions are available. |
public action_wp_enqueue_scripts ( ) : null | ||
리턴 | null |
public filter_srcset_array ( array $sources, $size_array, $image_src, $image_meta ) : array | ||
$sources | array | An array of image urls and widths. |
리턴 | array | An array of Photon image urls and widths. |
public static filter_the_content ( string $content ) : string | ||
$content | string | |
리턴 | string |
protected static image_sizes ( ) : array | ||
리턴 | array |
public static parse_dimensions_from_filename ( string $src ) : array | ||
$src | string | The image URL. |
리턴 | array | An array consisting of width and height. |
public static parse_images_from_html ( string $content ) : array | ||
$content | string | Some HTML. |
리턴 | array | An array of $images matches, where $images[0] is an array of full matches, and the link_url, img_tag, and img_url keys are arrays of those matches. |
protected static strip_image_dimensions_maybe ( string $src ) : string | ||
$src | string | The image URL |
리턴 | string |
protected static validate_image_url ( string $url ) : boolean | ||
$url | string | |
리턴 | boolean |
protected static $extensions |