Make WordPress Core

Changeset 29753


Ignore:
Timestamp:
09/21/2014 09:55:08 AM (10 years ago)
Author:
SergeyBiryukov
Message:

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

props collinsinternet, DrewAPicture.
fixes #29607.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r29737 r29753  
    158158 */
    159159function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
     160
     161    /**
     162     * Filter the caption text.
     163     *
     164     * Note: If the caption text is empty, the caption shortcode will not be appended
     165     * to the image HTML when inserted into the editor.
     166     *
     167     * Passing an empty value also prevents the 'image_add_caption_shortcode' filter
     168     * from being evaluated at the end of {@see image_add_caption()}.
     169     *
     170     * @since 4.1.0
     171     *
     172     * @param string $caption The original caption text.
     173     */
     174    $caption = apply_filters( 'image_add_caption_text', $caption );
    160175
    161176    /**
Note: See TracChangeset for help on using the changeset viewer.