Skip to content

Commit

Permalink
Documentation: Clarifies how to assign a template to a default Post Type
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 16, 2018
1 parent 513534d commit b86cbe2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.