#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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Bundled Theme | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
10 years ago
#3
@
10 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
@
10 years ago
- Summary Twenty Fourteen / Fifteen: category count transient allows incorrect preview when only 1 category → Twenty Fourteen, Fifteen, Seventeen: allow category display in post preview even when only 1 category
#6
@
9 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.
#9
@
9 years ago
@davidakennedy Can you review and merge my Twenty Sixteen patch also? https://github.com/WordPress/twentysixteen/pull/492
#10
@
9 years ago
- Milestone 4.8 → 4.8.1
- Resolution fixed
- Status closed → 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
@
9 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
@
9 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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?