Skip to content

Conversation

@grappler
Copy link
Member

What?

Get default category based of setting instead of hardcoded slug.

Why?

Fixes #41955

How?

Instead of using the hardcoded slug, the ID for the default category is fetched from the settings.

Testing Instructions

Test 1

  1. Create a new post and publish
  2. The suggestion for categories should show in the pre-publish panel

Test 2

  1. Create a new category
  2. Change the default category to the newly created category in the writing setting wp-admin/options-writing.php
  3. Create a new post with the new category
  4. Publish post and see the suggestion for categories in the pre-publish panel

Copy link
Member

@amustaque97 amustaque97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally and it works for me. Thank you for your contribution 👏🏻

I had a glimpse at the static check, not sure why it failed. Though it looks unrelated to your changes.

@amustaque97 amustaque97 requested a review from youknowriad June 26, 2022 20:33
@Mamaduka Mamaduka requested review from Mamaduka and removed request for youknowriad June 27, 2022 18:05
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended General Interface Parts of the UI which don't fall neatly under other labels. labels Jun 27, 2022
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. Thanks, @grappler!

@Mamaduka Mamaduka merged commit 024b339 into WordPress:trunk Jun 28, 2022
@github-actions github-actions bot added this to the Gutenberg 13.6 milestone Jun 28, 2022
@grappler grappler deleted the suggest-adding-category branch June 28, 2022 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggest picking a category on the pre-publish panel, only works for English

3 participants