diff --git a/packages/editor/src/dataviews/actions/export-pattern.tsx b/packages/editor/src/dataviews/actions/export-pattern.tsx index 57fb969d2ff29c..f4e5c91c7cabfa 100644 --- a/packages/editor/src/dataviews/actions/export-pattern.tsx +++ b/packages/editor/src/dataviews/actions/export-pattern.tsx @@ -22,7 +22,10 @@ function getJsonFromItem( item: Pattern ) { { __file: item.type, title: getItemTitle( item ), - content: item.content.raw, + content: + typeof item.content === 'string' + ? item.content + : item.content?.raw, syncStatus: item.wp_pattern_sync_status, }, null, diff --git a/packages/editor/src/dataviews/types.ts b/packages/editor/src/dataviews/types.ts index 02ce9964025789..9f57ecba6174aa 100644 --- a/packages/editor/src/dataviews/types.ts +++ b/packages/editor/src/dataviews/types.ts @@ -23,9 +23,7 @@ export interface TemplateOrTemplatePart extends BasePost { export interface Pattern extends BasePost { slug: string; title: { raw: string }; - content: { - raw: string; - }; + content: { raw: string } | string; wp_pattern_sync_status: string; }