Make WordPress Core

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#48411 closed enhancement (worksforme)

Sorting Block Items in Ascending Order

Reported by: vinoth06's profile vinoth06 Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.2.3
Component: Editor Keywords: 2nd-opinion
Focuses: Cc:


The Block items are not sorting in any order, it would be good to sort in Ascending order
Example Photo

To sort

  1. Open wp-includes/js/dist/block-editor.js
  2. Find the method BlockTypesList()
  3. Replace var items = _ref.items, with
var items = _ref.items.sort(function (a, b) {
                    var a1 = a.title, b1 = b.title;
                    if (a1 == b1) return 0;
                    return a1 > b1 ? 1 : -1;

Attachments (1)

12DCpnG.png (142.3 KB) - added by SergeyBiryukov 5 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
5 years ago

  • Keywords 2nd-opinion added

Thanks for the ticket!

I think the blocks are currently ordered in the supposed usage frequency. Not sure if ordering them by title would provide better experience here.

#2 @vinoth06
4 years ago

@SergeyBiryukov May be, but in future we can make an option in WordPress Gutenberg settings to show by frequency or title :-)

#3 @noisysocks
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Hi @vinoth06. In the latest version, blocks are sorted alphabetically within their categories.

Last edited 3 years ago by noisysocks (previous) (diff)
Note: See TracTickets for help on using tickets.