wp_get_attachment_caption
Filters the attachment caption.
Использование
add_filter( 'wp_get_attachment_caption', 'wp_kama_get_attachment_caption_filter', 10, 2 ); /** * Function for `wp_get_attachment_caption` filter-hook. * * @param string $caption Caption for the given attachment. * @param int $post_id Attachment ID. * * @return string */ function wp_kama_get_attachment_caption_filter( $caption, $post_id ){ // filter... return $caption; }
- $caption(строка)
- Caption for the given attachment.
- $post_id(int)
- Attachment ID.
Список изменений
С версии 4.6.0 | Введена. |
Где вызывается хук
wp_get_attachment_caption
wp-includes/post.php 6683
return apply_filters( 'wp_get_attachment_caption', $caption, $post->ID );