[wp-trac] [WordPress Trac] #29607: image_add_caption() returns immediately if caption empty, preventing filter from firing

WordPress Trac noreply at wordpress.org
Wed Oct 29 20:07:14 UTC 2014


#29607: image_add_caption() returns immediately if caption empty, preventing filter
from firing
--------------------------------------------+------------------------------
 Reporter:  paulschreiber                   |       Owner:  SergeyBiryukov
     Type:  enhancement                     |      Status:  reopened
 Priority:  normal                          |   Milestone:  4.1
Component:  Media                           |     Version:  trunk
 Severity:  normal                          |  Resolution:
 Keywords:  needs-testing has-patch commit  |     Focuses:  docs,
                                            |  administration
--------------------------------------------+------------------------------
Changes (by paulschreiber):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 This doesn't solve my problem. We want to be able to call
 `image_add_caption_shortcode()` even when caption is blank.

 The `isempty()` check is still present:
 {{{
     if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
         return $html;
 }}}

 Which means the function still returns before we get to call the filter.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29607#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list