[wp-trac] [WordPress Trac] #29607: image_add_caption() returns immediately if caption empty, preventing filter from firing
WordPress Trac
noreply at wordpress.org
Tue Sep 9 20:24:17 UTC 2014
#29607: image_add_caption() returns immediately if caption empty, preventing filter
from firing
----------------------------+-----------------------------
Reporter: paulschreiber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
In wp-admin/includes/media.php, the function `image_add_caption` returns
immediately if the caption is empty.
Our caption filter adds a credit even if the image has no caption.
However, because the filter is only fired at the end of image_add_caption:
{{{apply_filters( 'image_add_caption_shortcode', $shcode, $html );}}}
our filter never gets a chance to run when the caption is blank, so we
can't add the credit.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29607>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list