pfeifferNet

images.php

Responsive images handling.

Tags
since
1.3.0
since
6.0.0

Change image properties for new UI.

copyright

2024 Keith Pfeiffer

Table of Contents

Functions

add_image_sizes()  : void
Add custom image sizes.
filter_image_attributes()  : array<string|int, mixed>
Filter the image attributes.

Functions

add_image_sizes()

Add custom image sizes.

add_image_sizes() : void

Add cropping to default medium image. Specify the 400px wide 5x3 size. Add proportional size for medium images. Add 1160px wide 5x3 ratio for featured and in-post full-width images. Add 1160px wide proportional size for attachment pages.

Tags
since
1.3.0
since
6.0.0

Change image properties for new UI.

link
https://developer.wordpress.org/reference/hooks/after_setup_theme/
link
https://developer.wordpress.org/reference/functions/add_image_size/

filter_image_attributes()

Filter the image attributes.

filter_image_attributes(array<string|int, mixed> $attr, WP_Post $attachment, array<string|int, mixed>|string $size) : array<string|int, mixed>
Parameters
$attr : array<string|int, mixed>

Array of attribute values for the image markup, keyed by attribute name.

$attachment : WP_Post

Image attachment post.

$size : array<string|int, mixed>|string

Requested image size.

Tags
since
1.3.0
since
6.0.0

Change image properties for new UI.

link
https://developer.wordpress.org/reference/hooks/wp_get_attachment_image_attributes/
Return values
array<string|int, mixed>

The modified attribute values for markup.


        
On this page

Search results