To load pattern php files, create a patterns
folder, add a file.php with at least:
<?php
/*
* Title: required
* Slug: required
*/
Some content
Having a php file can be handy for translations.
Integration in a template file example :
<!-- wp:pattern {"slug":"df/content-404"} /-->
Note: for WordPress to be able to automatically look into the patterns folder, one need to add in wp-config.php
:
define( 'WP_ENVIRONMENT_TYPE', 'development' );
define( 'WP_DEVELOPMENT_MODE', 'theme' );
Sources: