Skip to content

Commit

Permalink
Fix inifinte loop
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Dec 2, 2020
1 parent 4b31f3f commit 46724a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ class EditorProvider extends Component {
}

getDefaultBlockContext( postId, postType ) {
// To avoid infinite loops, the template CPT shouldn't provide itself as a post content.
if ( postType === 'wp_template' ) {
return {};
}
return { postId, postType };
}

Expand Down

0 comments on commit 46724a8

Please sign in to comment.