Last active
October 20, 2022 02:32
-
-
Save DeveloperWil/d453448fd595bf00c8d30ffd90dd94db to your computer and use it in GitHub Desktop.
WP Enqueue JavaScript editor.js file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Block Editor Scripts | |
* Enqueue an editor.js file where you can add JavaScript to target block editor blocks | |
*/ | |
function wb_blockeditor_scripts() { | |
wp_enqueue_script( 'theme-editor', get_stylesheet_directory_uri() . '/assets/js/editor.js', array( 'wp-blocks', 'wp-dom' ), filemtime( get_stylesheet_directory() . '/assets/js/editor.js' ), true ); | |
} | |
add_action( 'enqueue_block_editor_assets', wb_blockeditor_scripts); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To view a list of all core block types | |
// Open the folder /wp-includes/blocks/ | |
// The name of each subfolder is the name used to register the block type. | |
core/archives | |
core/audio | |
core/button | |
core/buttons | |
core/calendar | |
core/categories | |
core/classic | |
core/code | |
core/column | |
core/columns | |
core/cover | |
core/file | |
core/freeform | |
core/gallery | |
core/group | |
core/heading | |
core/html | |
core/image | |
core/latest-comments | |
core/latest-posts | |
core/legacy-widget | |
core/list | |
core/loginout | |
core/media-text | |
core/more | |
core/nextpage | |
core/pagelist | |
core/paragraph | |
core/post-content | |
core/post-date | |
core/post-excerpt | |
core/post-featured-image | |
core/post-template | |
core/post-terms | |
core/post-title | |
core/preformatted | |
core/pullquote | |
core/query | |
core/query-pagination | |
core/query-pagination-next | |
core/query-pagination-numbers | |
core/query-pagination-previous | |
core/query-title | |
core/quote | |
core/rss | |
core/search | |
core/separator | |
core/shortcode | |
core/site-logo | |
core/site-tagline | |
core/site-title | |
core/social-link | |
core/social-links | |
core/spacer | |
core/table | |
core/tag-cloud | |
core/text-columns | |
core/verse | |
core/video |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp.domReady( () => { | |
wp.blocks.unregisterBlockType( 'core/heading' ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment