the_post_thumbnail_caption
Filter HookDescription
Filters the displayed post thumbnail caption.Hook Information
File Location |
wp-includes/post-thumbnail-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 328 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$caption
|
Caption for the given attachment. |
Usage Examples
Basic Usage
<?php
// Hook into the_post_thumbnail_caption
add_filter('the_post_thumbnail_caption', 'my_custom_filter', 10, 1);
function my_custom_filter($caption) {
// Your custom filtering logic here
return $caption;
}
Source Code Context
wp-includes/post-thumbnail-template.php:328
- How this hook is used in WordPress core
<?php
323 *
324 * @since 4.6.0
325 *
326 * @param string $caption Caption for the given attachment.
327 */
328 echo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) );
329 }
PHP Documentation
<?php
/**
* Filters the displayed post thumbnail caption.
*
* @since 4.6.0
*
* @param string $caption Caption for the given attachment.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/post-thumbnail-template.php
Related Hooks
Related hooks will be displayed here in future updates.