Fix category count when previewing with only 1 category #492

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@lancewillett
Contributor
lancewillett commented Jan 10, 2017 edited

Matches relevant fix for Twenty Fourteen, Fifteen, and Seventeen: https://core.trac.wordpress.org/ticket/39531

Steps to repeat

  1. Using a site with only the category, "Uncategorized, switch to Twenty Fourteen or Twenty Fifteen.
  2. Create new post draft, and in the post meta box for Categories add a new category.
  3. Save (don't publish), and Preview.
  4. The new category will not be in the preview.
  5. 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 twentysixteen_categorized_blog() returns false for 1 or fewer categories, in this case it won't show the new category.

Screenshots

Before fix

screen shot 2017-01-10 at 10 18 51

After fix

screen shot 2017-01-10 at 10 18 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment