HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/tiny-compress-images/docs/hooks/tiny_replace_with_picture.md
# tiny_replace_with_picture

Filter that allows you to skip converting page content `<img>` tags into `<picture>` elements. Returning `false` disables the feature completely for that request.
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.

**Location:** `src/class-tiny-plugin.php`  
**Since:** 3.7.0

## Arguments

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.

## Example

```php
add_filter(
	'tiny_replace_with_picture',
	function ( $should_replace ) {
		// Disable picture replacement on RSS feeds.
		if ( is_feed() ) {
			return false;
		}

		return $should_replace;
	}
);
```