WordPress.org

Make WordPress Core

Changes between Initial Version and Version 16 of Ticket #18311


Ignore:
Timestamp:
01/16/12 20:57:52 (4 years ago)
Author:
azaozz
Comment:

Replying to sushkov:

@jeremyclarke has a point when says that image caption content should go between [caption] shortcode tags.

Don't think changing the structure of the image caption shortcode is possible. This would break all plugins and themes that use it directly (we explicitly allow that in img_caption_shortcode() with the 'img_caption_shortcode' filter).

I rather see that as escaping all quotes or encoding the html string in caption="...", whichever works better. If we need to encode it, we can decode before running the 'img_caption_shortcode' filter to keep it back-compat.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18311

    • Property Status changed from new to assigned
    • Property Cc navjotjsingh@… jer@… kpayne@… xoodrew@… sushkov added
    • Property Summary changed from Caption shortcode doesn't support markup in the caption. to Support HTML in image captions.
    • Property Owner set to sushkov
    • Property Milestone changed from Awaiting Review to 3.4
    • Property Keywords needs-patch added
    • Property Type changed from enhancement to task (blessed)
  • Ticket #18311 – Description

    initial v16  
    11The ability to add any HTML formatting to text in captions is very limited. 
    22 
    3 - Markup can be added from the HTML editor as long as you don't switch to the visual editor and the markup does not contain any quotes. 
     3- HTML markup can be added from the HTML editor as long as you don't switch to the visual editor and the markup does not contain any quotes. 
     4- Currently the visual editor removes any HTML tags from captions. 
    45 
    5 - The visual editor seems to completely ignore any markup when outputting to the actual input field.  Adding styling like <b> or <i> to text within the visual editor shows, but it doesn't save, nor does it still exist when switching to the HTML view. 
     6To do: 
     7- Handle HTML in the caption text escaping/encoding it to pass through the shortcode matching regex. 
     8- Provide some way of adding HTML in the captions in the gallery -> image properties. (This may be limited to links only as they seem most needed). 
     9- Improve editing of caption text in the visual editor after inserting an image with caption or add third "popup button" to images that would add/remove captions directly without needing to open the uploader/gallery popup.