Skip to content

Editor: Enqueue assets for format library for the block editor#1125

Closed
gziolo wants to merge 1 commit intoWordPress:masterfrom
gziolo:update/format-library-enqueue
Closed

Editor: Enqueue assets for format library for the block editor#1125
gziolo wants to merge 1 commit intoWordPress:masterfrom
gziolo:update/format-library-enqueue

Conversation

@gziolo
Copy link
Copy Markdown
Member

@gziolo gziolo commented Mar 26, 2021

Trac ticket: https://core.trac.wordpress.org/ticket/52920

Ensures that wp-format-library assets are always loaded for the block editor. Otherwise, they have to be loaded individually for every screen that needs it. It's similar to how wp-block-directory assets are handled.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@gziolo
Copy link
Copy Markdown
Member Author

gziolo commented Mar 30, 2021

@youknowriad and @ellatrix – do you think it's safe to assume that we always need to load format library?

We do something similar for:

  • block directory with wp_enqueue_editor_block_directory_assets
  • block styles from WP_Block_Styles_Registry with enqueue_editor_block_styles_assets

@ellatrix
Copy link
Copy Markdown
Member

You mean for WordPress? I guess so, otherwise it should just have no formats available without errors.

@gziolo
Copy link
Copy Markdown
Member Author

gziolo commented Mar 31, 2021

You mean for WordPress? I guess so, otherwise it should just have no formats available without errors.

Yes, for WordPress. It's going to be loaded for all pages that render the block editor moving forward. Related commit: 0df2817.

@gziolo gziolo closed this Mar 31, 2021
@gziolo gziolo deleted the update/format-library-enqueue branch March 31, 2021 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants