Image

Single image entity

Properties

Property
Type

ID

Post ID

int

alt

Return alt value

string

cache_path

Only for remote image, return cache path

string

caption

Return caption value

string

date

Formatted post created date, see mysql2datearrow-up-right

string

date_gmt

Formatted post created gmt date, see mysql2datearrow-up-right

string

description

Post content

string

extension

File extension (.jpg, .png, ... )

string

file

Return relative file path

string

file_content

Return file content, usefull for svg

string

focus_point

Return focus point, available when using WP Smartcroparrow-up-right plugin

array

height

Image height

int

link

Return image link

string

meta(name)

Get post meta

mixed

custom_fields(name)

Get ACF value

mixed

mime_type

Image mime type

string

modified

Formatted post modified date, see mysql2datearrow-up-right

string

modified_gmt

Formatted post modified gmt date, see mysql2datearrow-up-right

string

filesize

Return image file size in bytes

int

src

Return image src

string

title

Image title

string

width

Image width

int

Examples

Process remote image

Allowed mime type : image/jpeg, image/jpg, image/gif, image/png

Invalidate image cache ( for remote )

Remote image are stored in cache for 30 days, in a controller or an action, you can force cache invalidation

Resize an image

Resize an image, and apply filters

Filter list

Resize implements Image interventionarrow-up-right methods

  • gcd

  • resize

  • insert

  • colorize

  • blur

  • flip

  • brightness

  • invert

  • mask

  • gamma

  • rotate

  • text

  • pixelate

  • greyscale

  • rectangle

  • circle

  • limitColors

Generate an image placeholder

Generate a transparent image pixel in base64

Generate a placeholder image using https://placehold.jparrow-up-right

Generate an advanced picture template

Return resized and compressed picture HTML

Output

Last updated