image_add_caption_shortcode
Filters the image HTML markup including the caption shortcode.
Usage
add_filter( 'image_add_caption_shortcode', 'wp_kama_image_add_caption_shortcode_filter', 10, 2 ); /** * Function for `image_add_caption_shortcode` filter-hook. * * @param string $shcode The image HTML markup with caption shortcode. * @param string $html The image HTML markup. * * @return string */ function wp_kama_image_add_caption_shortcode_filter( $shcode, $html ){ // filter... return $shcode; }
- $shcode(string)
- The image HTML markup with caption shortcode.
- $html(string)
- The image HTML markup.
Changelog
Since 2.6.0 | Introduced. |
Where the hook is called
wp-admin/includes/media.php 249
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );