#39531 closed defect (bug) (fixed)
Twenty Fourteen, Fifteen, Seventeen: allow category display in post preview even when only 1 category
Reported by: | lancewillett | Owned by: | davidakennedy |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
Steps to repeat
- Using a site with only the category, "Uncategorized, switch to Twenty Fourteen or Twenty Fifteen.
- Create new post draft, and in the post meta box for Categories add a new category.
- Save (don't publish), and Preview.
- The new category will not be in the preview.
- If you publish, the end result shows two categories, as expected.
What I expected
For the post preview to show the 2nd category I added, after saving the post.
What happened instead
The category is not shown in the preview. And because of how twentyfifteen_categorized_blog()
returns false for 1 or fewer categories, in this case it won't show the new category.
Screenshots
Attached.
Note: this occurs in Twenty Sixteen as well, bug logged in GitHub: https://github.com/WordPress/twentysixteen/pull/492
Attachments (8)
Change History (23)
#2
in reply to:
↑ description
@
8 years ago
#3
@
8 years ago
Looking at Twenty Seventeen though, seems like it would also be affected?
Good point, I missed it. Will add a patch here shortly.
Twenty Sixteen pull request added here: https://github.com/WordPress/twentysixteen/pull/492 — thanks for the reminder on that.
#4
@
8 years ago
- Summary changed from Twenty Fourteen / Fifteen: category count transient allows incorrect preview when only 1 category to Twenty Fourteen, Fifteen, Seventeen: allow category display in post preview even when only 1 category
#6
@
8 years ago
Great find @lancewillett! I tested and can confirm the bug. I also tested the patch and it works well. I think this one should be good to go.
#8
@
8 years ago
- Owner set to davidakennedy
- Resolution set to fixed
- Status changed from new to closed
In 40023:
#9
@
8 years ago
@davidakennedy Can you review and merge my Twenty Sixteen patch also? https://github.com/WordPress/twentysixteen/pull/492
#10
@
7 years ago
- Milestone changed from 4.8 to 4.8.1
- Resolution fixed deleted
- Status changed from closed to reopened
There's a consensus on merging Twenty Sixteen into core SVN in #36497, reopening to make sure it gets the fix as well.
#11
@
7 years ago
i don't know why needed twentyfifteen_categorized_blog(), twentysexteen_categorized_blog(), twentyseventeen_categorized_blog(), i will delete it from tamplate, or change inside function get_categories(array(...)) to get_the_category()
#12
@
7 years ago
I ported over the patch from Lance on https://github.com/WordPress/twentysixteen/pull/492/files since Twenty Sixteen is no longer maintained on GitHub. Make sure @lancewillett gets props.
Replying to lancewillett:
Per comment:1:ticket:38468, Twenty Sixteen issues should be reported on GitHub: https://github.com/WordPress/twentysixteen/issues.
Looking at Twenty Seventeen though, seems like it would also be affected?