From b86cbe25b02028aa9f4915f3b3ab58e49d399306 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 16 Jan 2018 14:14:44 +0100 Subject: [PATCH] Documentation: Clarifies how to assign a template to a default Post Type --- docs/templates.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/templates.md b/docs/templates.md index d21d5d653c21e..74e0007227a87 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -68,3 +68,17 @@ Sometimes the intention might be to lock the template on the UI so that the bloc - `all` — prevents all operations. - `insert` — prevents inserting new blocks, but allows moving existing ones. + +## Default Post Types + +It is also possible to assign a template to a default post type like "posts" and "pages": + +```php +$post_type_object = get_post_type_object( 'post' ); +$post_type_object->template = array( + array( 'core/paragraph', array( + 'placeholder' => 'Add Description...', + ) ), +); +$post_type_object->template_lock = 'all'; +``` \ No newline at end of file