From 46724a8c647d2e60057bcb4804066096e0d9dd4e Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 2 Dec 2020 10:26:09 +0100 Subject: [PATCH] Fix inifinte loop --- packages/editor/src/components/provider/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index e7d43e3fb70aa7..6c0d3f090b1ef1 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -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 }; }