WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#23965 closed defect (bug) (fixed)

Caption not showing in Post Format Image

Reported by: RDall Owned by: markjaquith
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: Post Formats Keywords: has-patch commit
Focuses: Cc:

Description

After testing the latest version of Twenty Thirteen there has been many improvements Most of which I am very happy to see. But not having the caption below the image of post-format image is a poor design decision. Here is why:

I can see many post the WordPress support forum asking why the captions can't be seen. For example this one: http://wordpress.org/support/topic/twenty-thirteen-image-post-image-doesnt-use-title-alt

If the user decides not to have a caption below there image. Let it be their choice. But asking for a caption in the upload portion of the site and then not displaying is counter intuitive.

I know I might be new to these parts (Trac and WordPress Development in general) But after 7 years as a professional photographer and then another 5 years as a web developer. I implore you to reverse this decision and the confusion it will surely and has already caused.

You could says… Yes that can be added a child theme… And I could do that… But that is not the reason for this request… It is for the large number of people who will think this is a bug, or they did something wrong or will make a frustrated posts to the forums. I am try the prevent that… 

Attachments (12)

23965.diff (6.1 KB) - added by wonderboymusic 8 years ago.
23965.2.diff (3.6 KB) - added by wonderboymusic 8 years ago.
23965.3.diff (2.7 KB) - added by wonderboymusic 8 years ago.
23965.4.diff (2.4 KB) - added by wonderboymusic 8 years ago.
23965.5.diff (4.6 KB) - added by wonderboymusic 8 years ago.
23965-tests.diff (1.0 KB) - added by wonderboymusic 8 years ago.
23965.6.diff (5.7 KB) - added by wonderboymusic 8 years ago.
23965.7.diff (6.0 KB) - added by wonderboymusic 8 years ago.
23965.8.diff (6.4 KB) - added by wonderboymusic 8 years ago.
23965.9.diff (7.1 KB) - added by wonderboymusic 8 years ago.
23965.10.diff (8.0 KB) - added by wonderboymusic 8 years ago.
23965.11.diff (7.6 KB) - added by wonderboymusic 8 years ago.

Download all attachments as: .zip

Change History (37)

#1 in reply to: ↑ description ; follow-up: @nacin
8 years ago

I imagine there have been previous discussions on this, somewhere?

Replying to RDall:

If the user decides not to have a caption below there image. Let it be their choice. But asking for a caption in the upload portion of the site and then not displaying is counter intuitive.

I would tend to agree.

#2 in reply to: ↑ 1 @RDall
8 years ago

Replying to nacin:

I imagine there have been previous discussions on this, somewhere?

I did check the Alpha / Beta Forum and did a search for captions in trac tickets before posting a new ticket. If there was a IRC chat regarding this subject I wasn't available to attended it.

#3 @mindctrl
8 years ago

  • Cc dailyrants@… added

Does this work with any theme in 3.6? I don't see that the caption is being saved in the post content anywhere with image format posts, and I don't see the caption showing up in other themes I'm trying.

#4 follow-up: @DrewAPicture
8 years ago

I'm reasonably certain hiding the caption wasn't intentional in the context of displaying it in the image format's content.

In Twenty Thirteen we're essentially using the_post_format_image() as a replacement for the_post_thumbnail() for image formats. If an image is present in the image format meta, all that gets passed back is the marked-up image (above the title). Unfortunately, this also applies to what gets displaying in the image format's content (below the title).

If Joen/Lancewillett only want the caption to show on the image format's content, that's fine but we need to differentiate that in get_the_post_format_image().

#5 @mindctrl
8 years ago

This ticket probably needs to be reassigned to another component, and IMO, dealt with before 3.6 goes live.

The new posts formats UI doesn't do what the "Add Media" workflow did/does. That workflow inserts to html into the post_content field, wrapping the image in the caption shortcode.

The new UI appears to be using the post's meta_key value in wp_postmeta to reference the image attached. This means all existing themes will not show the caption data, without some sort of modification, on new posts using the image format.

This also means that users who have been doing posts of the image format will not get the same functionality they did before 3.6.

#6 @RDall
8 years ago

  • Component changed from Bundled Theme to Post Formats
  • Summary changed from Return Caption to display under Post Format Image to Caption not showing in Post Format Image
  • Type changed from feature request to defect (bug)

#7 in reply to: ↑ 4 @RDall
8 years ago

Replying to DrewAPicture:

I'm reasonably certain hiding the caption wasn't intentional in the context of displaying it in the image format's content.

Okay that was my mis-understanding from http://wordpress.org/support/topic/twenty-thirteen-image-post-image-doesnt-use-title-alt#post-4057561

In Twenty Thirteen we're essentially using the_post_format_image() as a replacement for the_post_thumbnail() for image formats. If an image is present in the image format meta, all that gets passed back is the marked-up image (above the title). Unfortunately, this also applies to what gets displaying in the image format's content (below the title).

If Joen/Lancewillett only want the caption to show on the image format's content, that's fine but we need to differentiate that in get_the_post_format_image().

I'd still disagree that single image absolutely needs a caption IMHO.

I have changed this ticket to from feature request to defect (bug) and from Bundled Theme to Post Formats as it seems from mindctrl comments it more a bug with 3.6 then it is with twenty-thirteen

Last edited 8 years ago by RDall (previous) (diff)

#8 @helen
8 years ago

I expressed this concern with the switch back to a meta field for the image. Using the content area may be less intuitive, but there are lots of limitations to using a meta field that only accepts an attachment ID.

#9 @wonderboymusic
8 years ago

yeah, I am looking at this right now, meta field needs to be able to take whatever (ID, URL, shortcode, HTML) like audio / video do

#11 @wonderboymusic
8 years ago

this from #23831 needs to go in first: 23831.2.diff, so the JS doesn't have to contort twice - I assumed that patch was going in before beta 1, still not committed

#12 @wonderboymusic
8 years ago

the tl;dr of what the eventual patch will be: ID will work, but it is not what we will insert into the meta field. Meta field will contain URL or <img>, or HTML if it is linked, or shortcode if it is wrapped in caption. All of those things already work for audio / video in the same fashion. Also, when we are doing get_the_post_format_image(), $post->format_content will be the <img>, the <a><img> or the shortcode (parsed into HTML) found in the content. This means we have to reboot the JS for image in post-formats.js which I made changes to already to support dimensions and shortcodes for video in the above mentioned patch.

#13 @SergeyBiryukov
8 years ago

  • Milestone changed from Awaiting Review to 3.6

#14 follow-up: @lancewillett
8 years ago

  • Cc lancewillett added

I think it's valid for a theme to output the caption text as part of the "image from Image post format" -- the way @wonderboymusic describes above, as part of the parsed HTML caption.

The way I think of it is, this is the same HTML output that the Media tools would add to the post content when not using the Image post format. Could be just an image element with attributes, could be wrapped in an anchor, and could be a caption shortcode.

#15 in reply to: ↑ 14 @RDall
8 years ago

Replying to lancewillett:

I think it's valid for a theme to output the caption text as part of the "image from Image post format" -- the way @wonderboymusic describes above, as part of the parsed HTML caption.

The way I think of it is, this is the same HTML output that the Media tools would add to the post content when not using the Image post format. Could be just an image element with attributes, could be wrapped in an anchor, and could be a caption shortcode.

That sounds like a great idea Lance…


Can I chalk my confusion on the hiding the caption as my Jumping on the couch on Oprah moment?

#16 @lancewillett
8 years ago

  • Keywords needs-patch added

@wonderboymusic Were you working on a patch for this? Happy to test.

@wonderboymusic
8 years ago

#17 @wonderboymusic
8 years ago

  • Keywords has-patch added; needs-patch removed

Ready for testing 23965.diff​

Note: I didn't do the thing where I change the meta to act like audio / video

Last edited 8 years ago by wonderboymusic (previous) (diff)

#18 @wonderboymusic
8 years ago

Refreshed against last mammoth commit

#19 @wonderboymusic
8 years ago

  • Keywords commit added

Refreshed again, this one needs to get thrown in the pool

#20 @wonderboymusic
8 years ago

  • Keywords needs-unit-tests added

I'm going to make sure these funcs have Unit Tests

#21 @wonderboymusic
8 years ago

In 1262/tests:

Add more assertions for get_content_image(). See #23965.

#22 @wonderboymusic
8 years ago

  • Keywords needs-unit-tests removed

23965.5.diff makes all new Unit Tests pass. Need to write more unit tests for Post Format funcs to make sure get_tag_regex() remains stable

#23 @wonderboymusic
8 years ago

23965.6.diff​ includes Sergey's code from 24147.patch to make this work in other themes.

#24 @wonderboymusic
8 years ago

23965.7.diff​ alters some code based on Unit Tests for get_embedded_media() - confirms that get_tag_regex() works as expected based on these changes

#25 @markjaquith
8 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In 24066:

Multiple improvements to image post format insertion and display.

  • get_tag_regex() altered based on Unit Tests.
  • Changes to post-formats.js to provide size and link context during image selection.
  • Captions are now output in the_post_format_image() when present.
  • The meta value for url is respected for the image post format when the HTML in the image meta doesn't include a link

props wonderboymusic. fixes #23965, #23964. see #24147, #24046.

Note: See TracTickets for help on using tickets.