PluginProbe ʕ •ᴥ•ʔ
TinyPNG – JPEG, PNG & WebP image compression / 3.6.13
TinyPNG – JPEG, PNG & WebP image compression v3.6.13
3.7.0 3.6.14 trunk 1.0.0 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.4.0 1.5.0 1.6.0 1.7.0 1.7.1 1.7.2 2.0.0 2.0.1 2.0.2 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.0.0 3.0.1 3.1.0 3.2.0 3.2.1 3.3 3.4 3.4.1 3.4.2 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.10 3.6.11 3.6.12 3.6.13 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9
tiny-compress-images / docs / hooks / tiny_replace_with_picture.md
tiny-compress-images / docs / hooks Last commit date
index.md 8 months ago tiny_replace_with_picture.md 8 months ago
tiny_replace_with_picture.md
28 lines
1 # tiny_replace_with_picture
2
3 Filter that allows you to skip converting page content `<img>` tags into `<picture>` elements. Returning `false` disables the feature completely for that request.
4 The filter will fire on `init` with a default priority of `10`. Register your filter during or before `init` with a smaller priority than `10` to take effect.
5
6 **Location:** `src/class-tiny-plugin.php`
7 **Since:** 3.7.0
8
9 ## Arguments
10
11 1. `bool $should_replace` — boolean to control wether `<img>` elements on the page should be replaced by `<picture>` elements if they have an optimized version. Defaults to true. Return `false` to skip all `<picture>` replacements.
12
13 ## Example
14
15 ```php
16 add_filter(
17 'tiny_replace_with_picture',
18 function ( $should_replace ) {
19 // Disable picture replacement on RSS feeds.
20 if ( is_feed() ) {
21 return false;
22 }
23
24 return $should_replace;
25 }
26 );
27 ```
28