File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
packages/editor/src/store Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -121,21 +121,18 @@ export default {
121121 const isNewPost = post . status === 'auto-draft' ;
122122
123123 // Parse content as blocks
124- let blocks ;
124+ let blocks = parse ( post . content . raw ) ;
125125 let isValidTemplate = true ;
126- if ( ! isNewPost ) {
127- blocks = parse ( post . content . raw ) ;
128-
126+ if ( isNewPost && template ) {
127+ // Apply a template for new posts only, if exists.
128+ blocks = synchronizeBlocksWithTemplate ( blocks , template ) ;
129+ } else {
129130 // Unlocked templates are considered always valid because they act as default values only.
130131 isValidTemplate = (
131132 ! template ||
132133 templateLock !== 'all' ||
133134 doBlocksMatchTemplate ( blocks , template )
134135 ) ;
135- } else if ( template ) {
136- blocks = synchronizeBlocksWithTemplate ( [ ] , template ) ;
137- } else {
138- blocks = [ ] ;
139136 }
140137
141138 // Include auto draft title in edits while not flagging post as dirty
You can’t perform that action at this time.
0 commit comments