Filter hook 'image_make_intermediate_size'

in WP Core File wp-includes/class-wp-image-editor-gd.php at line 567

View Source

image_make_intermediate_size

Filter Hook
Description
Filters the name of the saved image file.

Hook Information

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

Hook Parameters

Type Name Description
string $filename Name of the file.

Usage Examples

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

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

Source Code Context

wp-includes/class-wp-image-editor-gd.php:567 - How this hook is used in WordPress core
<?php
 562  			 *
 563  			 * @since 2.6.0
 564  			 *
 565  			 * @param string $filename Name of the file.
 566  			 */
 567  			'file'      => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
 568  			'width'     => $this->size['width'],
 569  			'height'    => $this->size['height'],
 570  			'mime-type' => $mime_type,
 571  			'filesize'  => wp_filesize( $filename ),
 572  		);

PHP Documentation

<?php
/**
			 * Filters the name of the saved image file.
			 *
			 * @since 2.6.0
			 *
			 * @param string $filename Name of the file.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/class-wp-image-editor-gd.php
Related Hooks

Related hooks will be displayed here in future updates.