Skip to content

Instantly share code, notes, and snippets.

@annezazu
Created February 9, 2023 20:18
Show Gist options
  • Save annezazu/99ce2f84fa033dae48eacc50a8287bae to your computer and use it in GitHub Desktop.
Save annezazu/99ce2f84fa033dae48eacc50a8287bae to your computer and use it in GitHub Desktop.
Register patterns for specific template types
register_block_pattern(
'wp-my-theme/404-template-pattern',
array(
'title' => __( '404 Only template pattern', 'wp-my-theme' ),
'templateTypes' => array( '404' ),
'content' => '<!-- wp:paragraph {"align":"center","fontSize":"x-large"} --><p class="has-text-align-center has-x-large-font-size">404 pattern</p><!-- /wp:paragraph -->',
)
);
@annezazu
Copy link
Author

annezazu commented Feb 9, 2023

Code provided by @jonathanbossenger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment