From 10d5642aa3aec168ff83f7d951d76224ae436e6b Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 28 Jan 2026 20:55:41 +0000 Subject: [PATCH] Docs: Document the `contentOnly` value for the `$template_lock` argument when registering a post type. Props ocean90, mukesh27, johnbillion See #64224 Built from https://develop.svn.wordpress.org/trunk@61546 git-svn-id: http://core.svn.wordpress.org/trunk@60857 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-post-type.php | 1 + wp-includes/post.php | 20 +++++++++++--------- wp-includes/version.php | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/wp-includes/class-wp-post-type.php b/wp-includes/class-wp-post-type.php index 2f23edc733..b53a244d7d 100644 --- a/wp-includes/class-wp-post-type.php +++ b/wp-includes/class-wp-post-type.php @@ -303,6 +303,7 @@ final class WP_Post_Type { * and delete blocks. * - If set to 'insert', the user is able to move existing blocks but is unable to insert * new blocks and delete blocks. + * - If set to 'contentOnly', the user is only able to edit the content of existing blocks. * * Default false. * diff --git a/wp-includes/post.php b/wp-includes/post.php index e8f37ecc34..70abcfb113 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1799,15 +1799,17 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) * session. Each item should be an array containing block name and * optional attributes. Default empty array. * @type string|false $template_lock Whether the block template should be locked if $template is set. - * * If set to 'all', the user is unable to insert new blocks, - * move existing blocks and delete blocks. - * * If set to 'insert', the user is able to move existing blocks - * but is unable to insert new blocks and delete blocks. - * Default false. - * @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or - * "built-in" post_type. Default false. - * @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of - * this post type. Default 'post.php?post=%d'. + * * If set to 'all', the user is unable to insert new blocks, + * move existing blocks and delete blocks. + * * If set to 'insert', the user is able to move existing blocks + * but is unable to insert new blocks and delete blocks. + * * If set to 'contentOnly', the user is only able to edit the content + * of existing blocks. + * Default false. + * @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or + * "built-in" post_type. Default false. + * @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of + * this post type. Default 'post.php?post=%d'. * } * @return WP_Post_Type|WP_Error The registered post type object on success, * WP_Error object on failure. diff --git a/wp-includes/version.php b/wp-includes/version.php index 0f1fd5fc25..c933191f21 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.0-alpha-61545'; +$wp_version = '7.0-alpha-61546'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.