[wp-trac] [WordPress Trac] #62675: register new pattern catogory possible docs bug
WordPress Trac
noreply at wordpress.org
Tue Dec 10 11:56:55 UTC 2024
#62675: register new pattern catogory possible docs bug
--------------------------+-----------------------------
Reporter: backit | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Hi,
in
https://developer.wordpress.org/themes/patterns/registering-patterns
/#pattern-categories
the code to register a new pattern category does not work. Instead of
"themeslug/custom" should be "themeslug_custom" both in functions.php and
pattern file.
functions.php
{{{#!php
<?php
add_action( 'init', 'themeslug_register_pattern_categories' );
function themeslug_register_pattern_categories() {
register_block_pattern_category( 'themeslug_custom', array(
'label' => __( 'Theme Name: Custom', 'themeslug' ),
'description' => __( 'Custom patterns for Theme Name.',
'themeslug' )
) );
}
}}}
pattern file:
{{{#!php
<?php
/**
* Title: Hero
* Slug: themeslug/hero
* Categories: featured, themeslug_custom
*/
?>
<!-- Your block markup goes here. -->
}}}
Hope this is the right place (i did not find a bug document specific
place)
Best regards.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62675>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list