• Resolved Rick Hellewell

    (@rhellewellgmailcom)


    Using the ‘caption’ in the #img# tag does not write to the ‘caption’ meta field of the picture.

    #img1 caption='this is the caption'#

    I understand this is a known bug. Is there and ETA on the fix?

    Thanks….Rick…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Wayne Allen

    (@wayneallen-1)

    This is fixed in 1.8.21 released today.

    Thread Starter Rick Hellewell

    (@rhellewellgmailcom)

    I tested 1.8.22 and the captions (specified in the #img1 caption=’this is a caption’) is placed in the text via the HREF Code, and in the ALT parameter of the IMG tag. Here is what is generated (for lurkers) (URLs are santitized a bit, along with some extra line breaks for readability)

    <a class="gallery_colorbox cboxElement" href="https://www.mysite.com/subsite/wp-content/uploads/sites/2/2016/12/storm-tree-3.jpg" data-featherlight="image">
    
    <img class=" size-medium wp-image-83 alignleft " 
    src="https://www.mysite.com/subsite/wp-content/uploads/sites/2/2016/12/storm-tree-3-300x200.jpg" 
    
    alt="this is image 1" 
    
    srcset="https://www.mysite.com/subsite/wp-content/uploads/sites/2/2016
    /12/storm-tree-3-300x200.jpg 300w, https://www.mysite.com/subsite/wp-content/uploads/sites/2/2016/12/storm-tree-3-768x512.jpg 768w, https://www.mysite.com/subsite/wp-content/uploads/sites/2/2016/12/storm-tree-3-676x450.jpg 676w, https://www.mysite.com/subsite/wp-content/uploads/sites/2/2016/12/storm-tree-3.jpg 821w" 
    
    sizes="(max-width: 300px) 100vw, 300px" width="300px" height="200px">
    
    [Picture: this is image 1]
    </a>

    The caption, however, is not placed in the metadata for the picture (the info you see on the right when you click on a picture in the Media screen).

    It would seem that having the ‘caption’ value in the ‘caption’ metadata would be the intent of the ‘caption’ code. That way, a theme could use the caption-metadata to put the caption of the image below the image, rather than as the HREF text.

    Plugin Author Wayne Allen

    (@wayneallen-1)

    You can put the caption anywhere you want, that is the purpose of the image template.

    The reason Postie doesn’t add the caption to the metadata is that you can specify the same image multiple times with different captions.

    #img1 caption="This is image 1"# #img1 caption="This is also image 1"#

    If you really want the caption on the metadata you could use the postie_place_media filter. https://postieplugin.com/filter-postie_place_media/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Caption does not work’ is closed to new replies.