Add 'image_add_caption_text' filter for changing the pre-parse caption text before output to the editor.
props collinsinternet, DrewAPicture. fixes #29607. git-svn-id: https://develop.svn.wordpress.org/trunk@29753 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
191a7ead45
commit
9e673c7eee
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user