Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 1.21 KB

README.md

File metadata and controls

37 lines (22 loc) · 1.21 KB

UCLA Physical Sciences Block Types

Custom plugin to manage WordPress Gutenberg blocks.

How to use

In ucla-ps-block-types.js unregister block slugs to disable them from the editor.

Example

To disable unsupported blocks...

If block slug is core/columns then add unregisterBlockType

wp.blocks.unregisterBlockType( 'core/columns' );
wp.blocks.unregisterBlockType( 'core/latest-comments' );

To find out name of a block slug, view source and get name from data-type element.

Links

Hooks

Two hooks introduced to WordPress specifically for enqueueing block assets.

  • enqueue_block_editor_assets – This can be used to enqueue block scripts and styles in the admin editor only.
  • enqueue_block_assets – This is used to enqueue block scripts and styles in both the admin editor and frontend of the site.

For more info, view 2018 blog post by Jason YingLing

Contributors