Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#26961 closed defect (bug) (fixed)

Twenty Fourteen: Ephemera Widget shows full post content when displayed in single post or page

Reported by: mor10's profile mor10 Owned by:
Milestone: 3.9 Priority: normal
Severity: major Version: 3.8
Component: Bundled Theme Keywords: has-patch commit fixed-major
Focuses: ui Cc:


When the Twenty Fourteen Ephemera widget is set to display the Video, Image, or a couple of other Post Formats and the user has created long-form content truncated by the <!--more--> tag, the widget ignores the truncation and displays the full post content when on a single post or page. This is counter to the expectation of the user.

I'm filing this as an enhancement but it can be argued it is a bug.

While this usage scenario may fall outside of the intended scope of the Post Formats and widget in question, it is a realistic usage scenario in the real world. Since there is no limit on what type of or length of content can be added to a post with a Post Format applied we have to assume users will create long form content and use the <!--more--> tag for truncation. This same user would expect the truncation to carry over to the Ephemera Widget when displayed on single post and page views.

Proof of concept patch attached. Can likely be improved.

Attachments (4)

ephemera_widget_continue_unified.diff (939 bytes) - added by mor10 10 years ago.
Patch fixes issue described by way of recommended override code as per
26961.patch (723 bytes) - added by Frank Klein 10 years ago.
26961_alt.diff (714 bytes) - added by mor10 10 years ago.
Alternate positioning
26961.diff (873 bytes) - added by obenland 10 years ago.

Download all attachments as: .zip

Change History (11)

#1 @obenland
10 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 3.8.2
  • Severity changed from normal to major
  • Type changed from enhancement to defect (bug)

Since we're using the global only once, we can just set it in the $GLOBALS array. It would probably best to do that right after the $ephemera->the_post(); call to catch all cases of the following post format conditional.

@Frank Klein
10 years ago

#2 @Frank Klein
10 years ago

  • Keywords has-patch needs-testing added; needs-refresh removed

A refreshed patch according to @obenland's feedback. The new patch restores the global $more to its original value after the widget output, to avoid any issues that changing a global variable might cause.

10 years ago

Alternate positioning

#3 @mor10
10 years ago

A suggested amendment to Frank's patch moving the setting of the $tmp_more variable up below the $tmp_content_width variable. This is for consistency and ease of reading. The more variable does not impact any other element of the widget so I see no reason to move the setting down below $ephemera->the_post(); and mix it in with the output markup. This is of course mostly an aesthetic opinion.

This ticket was mentioned in IRC in #wordpress-themes by lancewillett. View the logs.

10 years ago

10 years ago

#5 @lancewillett
10 years ago

In 27124:

Twenty Fourteen: fix Ephemera Widget to avoid showing full post content when displayed in single post or page. Restore the global $more to its original value after the widget output to avoid any issues caused by changing a global variable.

Props obenland, mor10, Frank Klein. See #26961.

#6 @lancewillett
10 years ago

  • Keywords commit fixed-major added; needs-testing removed

#7 @nacin
10 years ago

  • Milestone changed from 3.8.2 to 3.9
  • Resolution set to fixed
  • Status changed from new to closed

lancewillett and I decided that we would be leaving all bundled theme tickets for 3.9. Given the timeline (and lack of severity) we won't be doing a theme update before then.

Note: See TracTickets for help on using tickets.