wp_get_attachment_thumb_url
Filter HookDescription
Filters the attachment thumbnail URL.Hook Information
File Location |
wp-includes/post.php
View on GitHub
|
Hook Type | Filter |
Line Number | 7011 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$thumbnail_url
|
URL for the attachment thumbnail. |
int
|
$post_id
|
Attachment ID. |
Usage Examples
Basic Usage
<?php
// Hook into wp_get_attachment_thumb_url
add_filter('wp_get_attachment_thumb_url', 'my_custom_filter', 10, 2);
function my_custom_filter($thumbnail_url, $post_id) {
// Your custom filtering logic here
return $thumbnail_url;
}
Source Code Context
wp-includes/post.php:7011
- How this hook is used in WordPress core
<?php
7006 * @since 2.1.0
7007 *
7008 * @param string $thumbnail_url URL for the attachment thumbnail.
7009 * @param int $post_id Attachment ID.
7010 */
7011 return apply_filters( 'wp_get_attachment_thumb_url', $thumbnail_url, $post_id );
7012 }
7013
7014 /**
7015 * Verifies an attachment is of a given type.
7016 *
PHP Documentation
<?php
/**
* Filters the attachment thumbnail URL.
*
* @since 2.1.0
*
* @param string $thumbnail_url URL for the attachment thumbnail.
* @param int $post_id Attachment ID.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/post.php
Related Hooks
Related hooks will be displayed here in future updates.