Skip to content

Commit c5e91cc

Browse files
committed
Docs: Document the contentOnly value for the $template_lock argument when registering a post type.
Props ocean90, mukesh27, johnbillion See #64224 git-svn-id: https://develop.svn.wordpress.org/trunk@61546 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4ef8507 commit c5e91cc

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/wp-includes/class-wp-post-type.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ final class WP_Post_Type {
303303
* and delete blocks.
304304
* - If set to 'insert', the user is able to move existing blocks but is unable to insert
305305
* new blocks and delete blocks.
306+
* - If set to 'contentOnly', the user is only able to edit the content of existing blocks.
306307
*
307308
* Default false.
308309
*

src/wp-includes/post.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,15 +1799,17 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
17991799
* session. Each item should be an array containing block name and
18001800
* optional attributes. Default empty array.
18011801
* @type string|false $template_lock Whether the block template should be locked if $template is set.
1802-
* * If set to 'all', the user is unable to insert new blocks,
1803-
* move existing blocks and delete blocks.
1804-
* * If set to 'insert', the user is able to move existing blocks
1805-
* but is unable to insert new blocks and delete blocks.
1806-
* Default false.
1807-
* @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or
1808-
* "built-in" post_type. Default false.
1809-
* @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of
1810-
* this post type. Default 'post.php?post=%d'.
1802+
* * If set to 'all', the user is unable to insert new blocks,
1803+
* move existing blocks and delete blocks.
1804+
* * If set to 'insert', the user is able to move existing blocks
1805+
* but is unable to insert new blocks and delete blocks.
1806+
* * If set to 'contentOnly', the user is only able to edit the content
1807+
* of existing blocks.
1808+
* Default false.
1809+
* @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or
1810+
* "built-in" post_type. Default false.
1811+
* @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of
1812+
* this post type. Default 'post.php?post=%d'.
18111813
* }
18121814
* @return WP_Post_Type|WP_Error The registered post type object on success,
18131815
* WP_Error object on failure.

0 commit comments

Comments
 (0)