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

WordPress Trac noreply at wordpress.org
Mon Nov 3 16:01:37 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
--------------------------------------------+------------------------------

Comment (by MikeHansenMe):

 looking at the code in image_add_caption, if you add something to $caption
 on line 175 via the filter it should not be empty on line 187 when
 checked. Then the only way line 188
 "return $html" would run is if disable_caption is true(which seems to be
 expected).

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


More information about the wp-trac mailing list