WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 4 months ago

Last modified 3 months ago

#50278 closed enhancement (fixed)

Editor: Update default block categories

Reported by: aduth Owned by: ellatrix
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch commit has-dev-note
Focuses: Cc:

Description

Related: https://github.com/WordPress/gutenberg/pull/19279

Background:

In GB#19279 (issue GB11406), the default set of block categories was updated.

The new set of block categories are:

  • Text
  • Media
  • Design
  • Widgets
  • Embeds
  • Reusable

Of the above, a few have remained unchanged: Widgets, Embeds, Reusable.

Mappings have been added to ensure that existing blocks will be assigned to as close as possible to an equivalent category in the new set:

  • Common → Text
  • Formatting → Text
  • Layout → Design

Task:

The default set of block categories implemented in Core PHP should be updated to correspond to these revisions.

This array:

https://github.com/WordPress/wordpress-develop/blob/5.4.1/src/wp-admin/includes/post.php#L2167-L2196

Attachments (2)

50278.diff (815 bytes) - added by aduth 5 months ago.
50278-i18n.diff (1.2 KB) - added by gziolo 4 months ago.
Translation context added

Download all attachments as: .zip

Change History (16)

@aduth
5 months ago

#1 @aduth
5 months ago

Open question: Should translator context or comment be provided for any of these new strings?

e.g. disambiguate as label of block category? Disambiguate "Text" or "Design" as verb vs. noun.

https://developer.wordpress.org/apis/handbook/internationalization/internationalization-guidelines/#disambiguation-by-context

There was none previously.

#2 @aduth
5 months ago

  • Keywords needs-dev-note added

#3 @gziolo
4 months ago

  • Keywords commit added

#4 @ocean90
4 months ago

  • Keywords needs-refresh added; commit removed

Should translator context or comment be provided for any of these new strings?

Yes, block category would be enough.

#5 @gziolo
4 months ago

  • Keywords commit added; needs-refresh removed

This is good to go after i18n part gets updated. We should merge is just before #50420 because otherwise the majority blocks won't be exposed in the inserter. With WordPress 5.5, the category name won't be mandatory anymore.

@gziolo
4 months ago

Translation context added

#6 @gziolo
4 months ago

Thanks @ocean90, I updated the patch to include translation context.

#7 @ellatrix
4 months ago

  • Owner set to ellatrix
  • Resolution set to fixed
  • Status changed from new to closed

In 48119:

Editor: Update default block categories

See https://github.com/WordPress/gutenberg/pull/19279.

Props aduth, gziolo.
Fixes #50278.

#8 @noisysocks
4 months ago

In 48130:

Editor: Revert [48119].

This commit caused the majority of blocks in the block editor to no longer
register as they reference the old category names.

See #50278.

#9 @noisysocks
4 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I reverted 48119 as it caused most blocks to throw an 'Unknown category' error when loading the block editor in trunk without the Gutenberg plugin activated. This made the block editor unusable in trunk and in Make/Core.

We'll need to commit this at the same time that packages are updated so that there aren't calls to registerBlockType() which use the old category.

This ticket was mentioned in Slack in #core by noisysocks. View the logs.


4 months ago

#11 @ellatrix
4 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 48177:

Editor: update JavaScript packages

Also update default block categories

Props youknowriad, gziolo, aduth.
Fixes #50420, #50278.

This ticket was mentioned in Slack in #core by justinahinon. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-editor by justinahinon. View the logs.


3 months ago

#14 @justinahinon
3 months ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.