Permalink
Browse files

Documentation: Clarifies how to assign a template to a default Post Type

  • Loading branch information...
youknowriad committed Jan 16, 2018
1 parent 513534d commit b86cbe25b02028aa9f4915f3b3ab58e49d399306
Showing with 14 additions and 0 deletions.
  1. +14 −0 docs/templates.md
View
@@ -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';
```

0 comments on commit b86cbe2

Please sign in to comment.