• Resolved conormaxwell

    (@conormaxwell)


    It seems from what I observe that there are two conflicting processes for image captions.

    In the Add Media process there is an input box for Caption. If you enter a caption there, it is saved in the attachment post_excerpt field (as per the codex), but is not displayed in the post by the_content() (using theme twentytwelve for example).

    If you go back and edit the image in the post (select image, click on Edit Image icon), the Caption input box is blank; it has not read the caption you previously entered in the Add Media process. If you enter a caption at this Edit Image stage, it is not saved in the attachment post_excerpt field, but it creates a caption shortcode in the body of the post, and is displayed in the post by the_content().

    I have looked for hours but not found where this is documented or discussed. (Though I have found a number of items about a change in the shortcode format between v3.4 and v3.5, and also Justin Tadlock’s very helpful article about modifying the shortcode output).

    Why doesn’t the WordPress Add Media function create a shortcode in the post, like the Edit Image process does ?

    And why doesn’t the Edit Image function check to see if there is an attachment post_excerpt and if so, use it as the initial value in its Caption input box ?

    And why doesn’t Edit Image update the attachment post_excerpt field to keep it inline with the caption shortcode. I realise that means same thing in two places (bad). Actually I would prefer that the actual caption text was always saved in and read from the attachment post_excerpt field by the shortcode or whatever, and not saved in the body of the post but that is just my personal requirement.

    I am having to tell my client to add the image into the post by Add Media (very nice), and then go and re-edit the image in the post in order to set the caption. It doesn’t seem right. Is that how it is supposed to be ? Have I missed or misunderstood something ?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image captions – not displayed until you Edit Image.’ is closed to new replies.