Skip to content

Commit

Permalink
Fix reverting template parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Jun 6, 2024
1 parent b9f2f66 commit a532cb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor/src/components/post-actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function isTemplateRemovable( template ) {
TEMPLATE_ORIGINS.custom
) &&
template.origin !== 'plugin' &&
template.templatePart?.origin !== 'plugin' &&
! template.has_theme_file &&
! template.templatePart?.has_theme_file
);
Expand Down Expand Up @@ -842,7 +843,10 @@ const isTemplatePartRevertable = ( item ) => {
return false;
}
const hasThemeFile = item.templatePart?.has_theme_file;
return canDeleteOrReset( item ) && hasThemeFile;
return (
canDeleteOrReset( item ) &&
( hasThemeFile || item.templatePart?.origin === 'plugin' )
);
};

const resetTemplateAction = {
Expand Down

0 comments on commit a532cb4

Please sign in to comment.