Add 'image_add_caption_text' filter for changing the pre-parse caption text before output to the editor.

props collinsinternet, DrewAPicture.
fixes #29607.
Built from https://develop.svn.wordpress.org/trunk@29753


git-svn-id: http://core.svn.wordpress.org/trunk@29525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-09-21 09:56:17 +00:00
parent cca3890c84
commit 79d017a024

View File

@ -158,6 +158,21 @@ function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel =
*/
function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
/**
* Filter the caption text.
*
* Note: If the caption text is empty, the caption shortcode will not be appended
* to the image HTML when inserted into the editor.
*
* Passing an empty value also prevents the 'image_add_caption_shortcode' filter
* from being evaluated at the end of {@see image_add_caption()}.
*
* @since 4.1.0
*
* @param string $caption The original caption text.
*/
$caption = apply_filters( 'image_add_caption_text', $caption );
/**
* Filter whether to disable captions.
*