Skip to content

Commit 66706c9

Browse files
Add: Documentation for postTypes pattern property.
This commit documents the postTypes property part of the block pattern registration added in WordPress/gutenberg#41791, and meanwhile backported into core. Props mcsf, ntsekouras. git-svn-id: https://develop.svn.wordpress.org/trunk@54850 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3016d48 commit 66706c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wp-includes/class-wp-block-patterns-registry.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ final class WP_Block_Patterns_Registry {
6868
* Certain blocks support further specificity besides the block name
6969
* (e.g. for `core/template-part` you can specify areas
7070
* like `core/template-part/header` or `core/template-part/footer`).
71+
* @type array $postTypes An array of post types that the pattern is restricted to be used with.
72+
* The pattern will only be available when editing one of the post types
73+
* passed on the array. For all the other post types not part of the array
74+
* the pattern is not available at all.
7175
* @type array $keywords Optional. A list of aliases or keywords that help users discover the
7276
* pattern while searching.
7377
* }

0 commit comments

Comments
 (0)