wp_create_thumbnail
Filter HookDescription
This was once used to create a thumbnail from an Image given a maximum side size.Hook Information
File Location |
wp-admin/includes/deprecated.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1137 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$file
|
Filename of the original image, Or attachment ID. |
int
|
$max_side
|
Maximum length of a single side for the thumbnail. |
mixed
|
$deprecated
|
Never used. |
Usage Examples
Basic Usage
<?php
// Hook into wp_create_thumbnail
add_filter('wp_create_thumbnail', 'my_custom_filter', 10, 3);
function my_custom_filter($file, $max_side, $deprecated) {
// Your custom filtering logic here
return $file;
}
Source Code Context
wp-admin/includes/deprecated.php:1137
- How this hook is used in WordPress core
<?php
1132 * @param mixed $deprecated Never used.
1133 * @return string Thumbnail path on success, Error string on failure.
1134 */
1135 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
1136 _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );
1137 return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
1138 }
1139
1140 /**
1141 * This was once used to display a meta box for the nav menu theme locations.
1142 *
PHP Documentation
<?php
/**
* This was once used to create a thumbnail from an Image given a maximum side size.
*
* @since 1.2.0
* @deprecated 3.5.0 Use image_resize()
* @see image_resize()
*
* @param mixed $file Filename of the original image, Or attachment ID.
* @param int $max_side Maximum length of a single side for the thumbnail.
* @param mixed $deprecated Never used.
* @return string Thumbnail path on success, Error string on failure.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-admin/includes/deprecated.php
Related Hooks
Related hooks will be displayed here in future updates.