@wordpress/block-library
Version:
Block library for the WordPress editor.
29 lines (28 loc) • 1.13 kB
JavaScript
import { __ } from "@wordpress/i18n";
// packages/block-library/src/post-date/variations.js
const variations = [{
name: "post-date",
title: __("Post Date"),
description: __("Display a post's publish date."),
attributes: { metadata: { bindings: { datetime: {
source: "core/post-data",
args: { field: "date" }
} } } },
scope: ["inserter", "transform"],
isActive: (blockAttributes) => blockAttributes?.metadata?.bindings?.datetime?.source === "core/post-data" && blockAttributes?.metadata?.bindings?.datetime?.args?.field === "date"
}, {
name: "post-date-modified",
title: __("Modified Date"),
description: __("Display a post's last updated date."),
attributes: {
metadata: { bindings: { datetime: {
source: "core/post-data",
args: { field: "modified" }
} } },
className: "wp-block-post-date__modified-date"
},
scope: ["inserter", "transform"],
isActive: (blockAttributes) => blockAttributes?.metadata?.bindings?.datetime?.source === "core/post-data" && blockAttributes?.metadata?.bindings?.datetime?.args?.field === "modified"
}];
export { variations as default };
//# sourceMappingURL=variations.mjs.map