Block Patterns

gomo/gomo-functions/template-patterns.php

File begins with option to remove the core block patterns that are already available/

remove_theme_support('core-block-patterns');

Register new block patterns.

register_block_pattern(
	'example-block-pattern/my-custom-pattern',
	array(
		'title'   => __( 'Example Pattern', 'example-block-pattern' ),
		'description' => _x( 'Just an example of a basic pattern', 'example-block-pattern' ),
		'content' => '<!-- wp:heading --><h2>Heading</h2><!-- /wp:heading -->', // make sure there's no line breaks
		'categories'  => array('text'), // buttons, columns, gallery, header, text
	)
);

Important to no have line breaks or extra spaces
https://www.textfixer.com/tools/remove-line-breaks.php is useful for this

Search the site


Address

123 Main Street
Town
City
P05T C0D3

Tel: 01234 567 899

Mob: 01234 567 899

Email: ben@gomopress.com


Copyright 2023. Blah blah blah Company Limited