Filter hook 'image_strip_meta'

in WP Core File wp-includes/class-wp-image-editor-imagick.php at line 442

View Source

image_strip_meta

Filter Hook
Description
Filters whether to strip metadata from images when they're resized. This filter only applies when resizing using the Imagick editor since GD always strips profiles by default.

Hook Information

File Location wp-includes/class-wp-image-editor-imagick.php View on GitHub
Hook Type Filter
Line Number 442

Hook Parameters

Type Name Description
bool $strip_meta Whether to strip image metadata during resizing. Default true.

Usage Examples

Basic Usage
<?php
// Hook into image_strip_meta
add_filter('image_strip_meta', 'my_custom_filter', 10, 1);

function my_custom_filter($strip_meta) {
    // Your custom filtering logic here
    return $strip_meta;
}

Source Code Context

wp-includes/class-wp-image-editor-imagick.php:442 - How this hook is used in WordPress core
<?php
 437  		 *
 438  		 * @since 4.5.0
 439  		 *
 440  		 * @param bool $strip_meta Whether to strip image metadata during resizing. Default true.
 441  		 */
 442  		if ( apply_filters( 'image_strip_meta', $strip_meta ) ) {
 443  			$this->strip_meta(); // Fail silently if not supported.
 444  		}
 445  
 446  		try {
 447  			/*

PHP Documentation

<?php
/**
		 * Filters whether to strip metadata from images when they're resized.
		 *
		 * This filter only applies when resizing using the Imagick editor since GD
		 * always strips profiles by default.
		 *
		 * @since 4.5.0
		 *
		 * @param bool $strip_meta Whether to strip image metadata during resizing. Default true.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/class-wp-image-editor-imagick.php
Related Hooks

Related hooks will be displayed here in future updates.