import { __ } from "@wordpress/i18n"; import { useBlockProps } from "@wordpress/block-editor"; import { useSelect } from "@wordpress/data"; import "./editor.scss"; import { useEntityRecords } from "@wordpress/core-data"; import { InnerBlocks } from "@wordpress/block-editor"; export default function Edit() { const lang = "fr"; // const items = useEntityRecords("postType", "post", { // per_page: -1, // status: "publish", // // taxonomy: "news_type", // news_type: [1], // }); const newsPosts = useSelect((select) => select("core").getEntityRecords("postType", "post", { per_page: -1, status: "publish", news_type: [95], }) ); return (

{__( "Les communiqués de presses seront affichés ici", "homegrade-blocks__text-backoffice" )}

{newsPosts && newsPosts.map((post) => { return ( <>
{/* */}
); })}
); }