Filter hook 'wp_get_attachment_thumb_file'

in WP Core File wp-includes/deprecated.php at line 4376

View Source

wp_get_attachment_thumb_file

Filter Hook
Description
Filters the attachment thumbnail file path.

Hook Information

File Location wp-includes/deprecated.php View on GitHub
Hook Type Filter
Line Number 4376

Hook Parameters

Type Name Description
string $thumbfile File path to the attachment thumbnail.
int $post_id Attachment ID.

Usage Examples

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

function my_custom_filter($thumbfile, $post_id) {
    // Your custom filtering logic here
    return $thumbfile;
}

Source Code Context

wp-includes/deprecated.php:4376 - How this hook is used in WordPress core
<?php
4371  			 * @since 2.1.0
4372  			 *
4373  			 * @param string $thumbfile File path to the attachment thumbnail.
4374  			 * @param int    $post_id   Attachment ID.
4375  			 */
4376  			return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
4377  		}
4378  	}
4379  
4380  	return false;
4381  }

PHP Documentation

<?php
/**
			 * Filters the attachment thumbnail file path.
			 *
			 * @since 2.1.0
			 *
			 * @param string $thumbfile File path to the attachment thumbnail.
			 * @param int    $post_id   Attachment ID.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/deprecated.php
Related Hooks

Related hooks will be displayed here in future updates.