Opened 11 years ago
Closed 11 years ago
#26961 closed defect (bug) (fixed)
Twenty Fourteen: Ephemera Widget shows full post content when displayed in single post or page
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | major | Version: | 3.8 |
Component: | Bundled Theme | Keywords: | has-patch commit fixed-major |
Focuses: | ui | Cc: |
Description
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)
Change History (11)
#1
@
11 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.
#2
@
11 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.
#3
@
11 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.
Patch fixes issue described by way of recommended override code as per http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior