@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
26 lines (23 loc) • 830 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isTemplateRevertable;
var _constants = require("../constants");
/**
* Internal dependencies
*/
// Copy of the function from packages/edit-site/src/utils/is-template-revertable.js
/**
* Check if a template or template part is revertable to its original theme-provided file.
*
* @param {Object} templateOrTemplatePart The entity to check.
* @return {boolean} Whether the entity is revertable.
*/
function isTemplateRevertable(templateOrTemplatePart) {
if (!templateOrTemplatePart) {
return false;
}
return templateOrTemplatePart.source === _constants.TEMPLATE_ORIGINS.custom && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file);
}
//# sourceMappingURL=is-template-revertable.js.map