image_strip_meta

Filters whether to strip metadata from images when they're resized.

Description

apply_filters( 'image_strip_meta', (bool) $strip_meta ); 

This filter only applies when resizing using the Imagick editor since GD always strips profiles by default.

Parameters (1)

0. $strip_meta (bool)
Whether to strip image metadata during resizing. Default true.

Usage

To run the hook, copy the example below.
  1. $strip_meta = apply_filters( 'image_strip_meta', $strip_meta ); 
  2.  
  3. if ( !empty( $strip_meta ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the image_strip_meta callback 
  2. function filter_image_strip_meta( $strip_meta ) { 
  3. // make filter magic happen here... 
  4. return $strip_meta
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'image_strip_meta', 'filter_image_strip_meta', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'image_strip_meta', 'filter_image_strip_meta', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/class-wp-image-editor-imagick.php  
  1. if ( apply_filters( 'image_strip_meta', $strip_meta ) ) {