How to use @wordpress/block-library - 6 common examples

To help you get started, we’ve selected a few @wordpress/block-library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / edit-post / src / index.native.js View on Github external
export function initializeEditor() {
	// register and setup blocks
	registerCoreBlocks();

	// disable Code and More blocks for the release
	// eslint-disable-next-line no-undef
	if ( typeof __DEV__ === 'undefined' || ! __DEV__ ) {
		unregisterBlockType( 'core/code' );
		unregisterBlockType( 'core/more' );
	}
}
github WordPress / gutenberg / packages / edit-site / src / index.js View on Github external
export function initialize( id, settings ) {
	registerCoreBlocks();
	if ( process.env.GUTENBERG_PHASE === 2 ) {
		__experimentalRegisterExperimentalCoreBlocks( settings );
	}
	render( , document.getElementById( id ) );
}
github WordPress / gutenberg / packages / edit-widgets / src / index.js View on Github external
export function customizerInitialize( id, settings ) {
	registerCoreBlocks();
	render(
		,
		document.getElementById( id )
	);
}
github WordPress / gutenberg / packages / edit-post / src / index.js View on Github external
export function initializeEditor( id, postType, postId, settings, initialEdits ) {
	const target = document.getElementById( id );
	const reboot = reinitializeEditor.bind( null, postType, postId, target, settings, initialEdits );

	registerCoreBlocks();

	dispatch( 'core/nux' ).triggerGuide( [
		'core/editor.inserter',
		'core/editor.settings',
		'core/editor.preview',
		'core/editor.publish',
	] );

	render(
		,
github WordPress / gutenberg / packages / edit-widgets / src / index.js View on Github external
export function initialize( id, settings ) {
	registerCoreBlocks();
	render(
		,
		document.getElementById( id )
	);
}
github WordPress / gutenberg / packages / edit-site / src / index.js View on Github external
export function initialize( id, settings ) {
	registerCoreBlocks();
	if ( process.env.GUTENBERG_PHASE === 2 ) {
		__experimentalRegisterExperimentalCoreBlocks( settings );
	}
	render( , document.getElementById( id ) );
}

@wordpress/block-library

Block library for the WordPress editor.

GPL-2.0-or-later
Latest version published 12 days ago

Package Health Score

95 / 100
Full package analysis