diff --git a/blocks/post-content-container/build/index.js.map b/blocks/post-content-container/build/index.js.map
index 55b010f..cc2f822 100644
--- a/blocks/post-content-container/build/index.js.map
+++ b/blocks/post-content-container/build/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACuB;AAK7B;AACR;AACqB;AAEA;AACa;AACC;AAE3C,SAASU,oBAAoBA,CAAC;EAC5CC,aAAa;EACbC,aAAa;EACbC;AACD,CAAC,EAAE;EACF,IAAI,CAACA,QAAQ,IAAI,CAACF,aAAa,EAAE,OAAOG,oDAAA,YAAG,SAAU,CAAC;EAEtD,IAAI,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGR,4DAAQ,CAAC,IAAI,CAAC;EAElD,MAAMS,IAAI,GAAGC,0BAA0B,CAAC,0BAA0B,CAAC;EACnE,MAAMC,WAAW,GAAGb,0DAAS,CAC3Bc,MAAM,IAAK;IACX,IAAI,CAACP,QAAQ,EAAE,OAAO,IAAI;IAC1B,IAAIQ,KAAK,GAAG;MACXC,MAAM,EAAE,SAAS;MACjBC,QAAQ,EAAE,CAAC,CAAC;MACZN,IAAI,EAAEA;IACP,CAAC;IACD,OAAOG,MAAM,CAAC,MAAM,CAAC,CAACI,gBAAgB,CAAC,UAAU,EAAEX,QAAQ,EAAEQ,KAAK,CAAC;EACpE,CAAC,EACD,CAACR,QAAQ,EAAEI,IAAI,CAChB,CAAC;EACD,MAAMQ,OAAO,GAAGb,aAAa,GACzB,GAAEc,MAAM,CAACC,QAAQ,CAACC,MAAO,2BAA0BhB,aAAc,cAAa,GAC/E,IAAI;EACP,SAASM,0BAA0BA,CAACW,MAAM,EAAE;IAC3C,IAAIC,OAAO,GAAGC,QAAQ,CAACC,MAAM;MAC5BC,OAAO,GAAGH,OAAO,CAACI,OAAO,CAAC,GAAG,GAAGL,MAAM,GAAG,GAAG,CAAC;IAC9C,IAAII,OAAO,IAAI,CAAC,CAAC,EAAEA,OAA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;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/OptionsSelectControl.js","webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/transforms.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"htmlEntities\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\r\nimport { InspectorControls } from \"@wordpress/block-editor\";\r\nimport {\r\n\tPanelBody,\r\n\tSelectControl,\r\n\tComboboxControl,\r\n} from \"@wordpress/components\";\r\nimport \"./editor.scss\";\r\nimport { Tip } from \"@wordpress/components\";\r\n\r\nimport { useSelect } from \"@wordpress/data\";\r\nimport { useEffect, useState } from \"@wordpress/element\";\r\nimport { decodeEntities } from \"@wordpress/html-entities\";\r\n\r\nexport default function OptionsSelectControl({\r\n\tsetAttributes,\r\n\trelatedPostId,\r\n\tpostType,\r\n}) {\r\n\tif (!postType || !setAttributes) return
Loading
;\r\n\r\n\tlet [postOptions, setPostOptions] = useState(null);\r\n\r\n\tconst lang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\r\n\tconst optionPages = useSelect(\r\n\t\t(select) => {\r\n\t\t\tif (!postType) return null;\r\n\t\t\tlet query = {\r\n\t\t\t\tstatus: \"publish\",\r\n\t\t\t\tper_page: -1,\r\n\t\t\t\tlang: lang,\r\n\t\t\t};\r\n\t\t\treturn select(\"core\").getEntityRecords(\"postType\", postType, query);\r\n\t\t},\r\n\t\t[postType, lang],\r\n\t);\r\n\tconst editUrl = relatedPostId\r\n\t\t? `${window.location.origin}/wp-admin/post.php?post=${relatedPostId}&action=edit`\r\n\t\t: null;\r\n\tfunction getAdminLanguageFromCookie(c_name) {\r\n\t\tvar c_value = document.cookie,\r\n\t\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\r\n\t\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\r\n\t\tif (c_start == -1) {\r\n\t\t\tc_value = null;\r\n\t\t} else {\r\n\t\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\r\n\t\t\tvar c_end = c_value.indexOf(\";\", c_start);\r\n\t\t\tif (c_end == -1) {\r\n\t\t\t\tc_end = c_value.length;\r\n\t\t\t}\r\n\t\t\tc_value = unescape(c_value.substring(c_start, c_end));\r\n\t\t}\r\n\t\treturn c_value;\r\n\t}\r\n\r\n\tfunction handleRelatedPostChange(postId) {\r\n\t\tsetAttributes({ relatedPostId: Number(postId) });\r\n\t}\r\n\tfunction handlePostTypeChange(postType) {\r\n\t\tsetAttributes({ postType: postType, relatedPostId: null });\r\n\t}\r\n\r\n\tfunction buildSelectOptions(optionPages) {\r\n\t\tlet options = [];\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\toptions.push({ value: 0, label: \"Selectionnez une page\" });\r\n\t\t\toptionPages.forEach((page) => {\r\n\t\t\t\toptions.push({\r\n\t\t\t\t\tvalue: page.id,\r\n\t\t\t\t\tlabel: decodeEntities(page.title.rendered),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\toptions.push({ value: 0, label: \"Pas encore de questions...\" });\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!optionPages || !postType) return;\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\tsetPostOptions(buildSelectOptions(optionPages));\r\n\t\t}\r\n\t}, [optionPages, postType]);\r\n\r\n\tlet panelTitle = \"Post Reliée\";\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t \r\n\r\n\t\t\t\t{postOptions && (\r\n\t\t\t\t\t handleRelatedPostChange(e)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t\t{relatedPostId && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{__(\r\n\t\t\t\t\t\t\t\"Pour modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.\",\r\n\t\t\t\t\t\t\t\"homegrade-blocks\",\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t \r\n\t\t\t\t)}\r\n\t\t\t\t{relatedPostId && editUrl && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tÉditer le post\r\n\t\t\t\t\t \r\n\t\t\t\t)}\r\n\t\t\t \r\n\t\t \r\n\t);\r\n}\r\n","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps } from \"@wordpress/block-editor\";\n\nimport { useSelect } from \"@wordpress/data\"; // pour les querry\nimport \"./editor.scss\";\nimport { RawHTML } from \"@wordpress/element\";\nimport { useEffect } from \"@wordpress/element\";\nimport { decodeEntities } from \"@wordpress/html-entities\";\nimport OptionsSelectControl from \"./OptionsSelectControl\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { relatedPostId, postType } = attributes;\n\n\tlet currentRelatedPost = useSelect(\n\t\t(select) =>\n\t\t\trelatedPostId && postType\n\t\t\t\t? select(\"core\").getEntityRecord(\"postType\", postType, relatedPostId)\n\t\t\t\t: null,\n\t\t[relatedPostId, postType],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t \n\n\t\t\t\n\t\t\t\t{!relatedPostId && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{__(\n\t\t\t\t\t\t\t\t\"Ce bloc n'est relié à aucune question. Rattachez-le à une fiche question dans la barre latérale.\",\n\t\t\t\t\t\t\t\t\"homegrade-blocks__texte-backoffice\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t
\n\t\t\t\t\t>\n\t\t\t\t)}\n\n\t\t\t\t{currentRelatedPost &&\n\t\t\t\t\tcurrentRelatedPost.content &&\n\t\t\t\t\tcurrentRelatedPost.title && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{decodeEntities(currentRelatedPost.title.rendered)} \n\t\t\t\t\t\t\t{currentRelatedPost.content.rendered} \n\t\t\t\t\t\t>\n\t\t\t\t\t)}\n\t\t\t \n\t\t>\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\nimport transforms from \"./transforms\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\n\tedit: Edit,\n\ttransforms: transforms,\n});\n","import { createBlock } from \"@wordpress/blocks\";\r\n\r\nconst transforms = {\r\n\tto: [\r\n\t\t/* supported to transforms */\r\n\t],\r\n\tfrom: [\r\n\t\t{\r\n\t\t\ttype: \"block\",\r\n\t\t\tblocks: [\"homegrade-content-blocks/questions-container\"],\r\n\t\t\ttransform: ({ relatedPostId }) => {\r\n\t\t\t\treturn createBlock(\"homegrade-content-blocks/post-content-container\", {\r\n\t\t\t\t\trelatedPostId,\r\n\t\t\t\t\tpostType: \"questions\",\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\ttype: \"block\",\r\n\t\t\tblocks: [\"core/paragraph\"],\r\n\t\t\ttransform: () => {\r\n\t\t\t\treturn createBlock(\"homegrade-content-blocks/post-content-container\");\r\n\t\t\t},\r\n\t\t},\r\n\t],\r\n};\r\n\r\nexport default transforms;\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"htmlEntities\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","InspectorControls","PanelBody","SelectControl","ComboboxControl","Tip","useSelect","useEffect","useState","decodeEntities","OptionsSelectControl","setAttributes","relatedPostId","postType","createElement","postOptions","setPostOptions","lang","getAdminLanguageFromCookie","optionPages","select","query","status","per_page","getEntityRecords","editUrl","window","location","origin","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring","handleRelatedPostChange","postId","Number","handlePostTypeChange","buildSelectOptions","options","push","value","label","forEach","page","id","title","rendered","panelTitle","onChange","e","href","className","useBlockProps","RawHTML","Edit","attributes","currentRelatedPost","getEntityRecord","Fragment","content","registerBlockType","metadata","transforms","name","icon","src","xmlns","width","height","viewBox","class","d","foreground","edit","createBlock","to","from","type","blocks","transform"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACuB;AAK7B;AACR;AACqB;AAEA;AACa;AACC;AAE3C,SAASU,oBAAoBA,CAAC;EAC5CC,aAAa;EACbC,aAAa;EACbC;AACD,CAAC,EAAE;EACF,IAAI,CAACA,QAAQ,IAAI,CAACF,aAAa,EAAE,OAAOG,oDAAA,YAAG,SAAU,CAAC;EAEtD,IAAI,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGR,4DAAQ,CAAC,IAAI,CAAC;EAElD,MAAMS,IAAI,GAAGC,0BAA0B,CAAC,0BAA0B,CAAC;EACnE,MAAMC,WAAW,GAAGb,0DAAS,CAC3Bc,MAAM,IAAK;IACX,IAAI,CAACP,QAAQ,EAAE,OAAO,IAAI;IAC1B,IAAIQ,KAAK,GAAG;MACXC,MAAM,EAAE,SAAS;MACjBC,QA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ACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/OptionsSelectControl.js","webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/transforms.js","webpack://multiblocks/./src/editor.scss?d446","webpack://multiblocks/./src/style.scss?d1e4","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"htmlEntities\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\r\nimport { InspectorControls } from \"@wordpress/block-editor\";\r\nimport {\r\n\tPanelBody,\r\n\tSelectControl,\r\n\tComboboxControl,\r\n} from \"@wordpress/components\";\r\nimport \"./editor.scss\";\r\nimport { Tip } from \"@wordpress/components\";\r\n\r\nimport { useSelect } from \"@wordpress/data\";\r\nimport { useEffect, useState } from \"@wordpress/element\";\r\nimport { decodeEntities } from \"@wordpress/html-entities\";\r\n\r\nexport default function OptionsSelectControl({\r\n\tsetAttributes,\r\n\trelatedPostId,\r\n\tpostType,\r\n}) {\r\n\tif (!postType || !setAttributes) return Loading
;\r\n\r\n\tlet [postOptions, setPostOptions] = useState(null);\r\n\r\n\tconst lang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\r\n\tconst optionPages = useSelect(\r\n\t\t(select) => {\r\n\t\t\tif (!postType) return null;\r\n\t\t\tlet query = {\r\n\t\t\t\tstatus: \"publish\",\r\n\t\t\t\tper_page: -1,\r\n\t\t\t\tlang: lang,\r\n\t\t\t};\r\n\t\t\treturn select(\"core\").getEntityRecords(\"postType\", postType, query);\r\n\t\t},\r\n\t\t[postType, lang],\r\n\t);\r\n\tconst editUrl = relatedPostId\r\n\t\t? `${window.location.origin}/wp-admin/post.php?post=${relatedPostId}&action=edit`\r\n\t\t: null;\r\n\tfunction getAdminLanguageFromCookie(c_name) {\r\n\t\tvar c_value = document.cookie,\r\n\t\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\r\n\t\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\r\n\t\tif (c_start == -1) {\r\n\t\t\tc_value = null;\r\n\t\t} else {\r\n\t\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\r\n\t\t\tvar c_end = c_value.indexOf(\";\", c_start);\r\n\t\t\tif (c_end == -1) {\r\n\t\t\t\tc_end = c_value.length;\r\n\t\t\t}\r\n\t\t\tc_value = unescape(c_value.substring(c_start, c_end));\r\n\t\t}\r\n\t\treturn c_value;\r\n\t}\r\n\r\n\tfunction handleRelatedPostChange(postId) {\r\n\t\tsetAttributes({ relatedPostId: Number(postId) });\r\n\t}\r\n\tfunction handlePostTypeChange(postType) {\r\n\t\tsetAttributes({ postType: postType, relatedPostId: null });\r\n\t}\r\n\r\n\tfunction buildSelectOptions(optionPages) {\r\n\t\tlet options = [];\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\toptions.push({ value: 0, label: \"Selectionnez une page\" });\r\n\t\t\toptionPages.forEach((page) => {\r\n\t\t\t\toptions.push({\r\n\t\t\t\t\tvalue: page.id,\r\n\t\t\t\t\tlabel: decodeEntities(page.title.rendered),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\toptions.push({ value: 0, label: \"Pas encore de questions...\" });\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!optionPages || !postType) return;\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\tsetPostOptions(buildSelectOptions(optionPages));\r\n\t\t}\r\n\t}, [optionPages, postType]);\r\n\r\n\tlet panelTitle = \"Post Reliée\";\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t \r\n\r\n\t\t\t\t{postOptions && (\r\n\t\t\t\t\t handleRelatedPostChange(e)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t\t{relatedPostId && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{__(\r\n\t\t\t\t\t\t\t\"Pour modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.\",\r\n\t\t\t\t\t\t\t\"homegrade-blocks\",\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t \r\n\t\t\t\t)}\r\n\t\t\t\t{relatedPostId && editUrl && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tÉditer le post\r\n\t\t\t\t\t \r\n\t\t\t\t)}\r\n\t\t\t \r\n\t\t \r\n\t);\r\n}\r\n","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps } from \"@wordpress/block-editor\";\n\nimport { useSelect } from \"@wordpress/data\"; // pour les querry\nimport \"./editor.scss\";\nimport { RawHTML } from \"@wordpress/element\";\nimport { useEffect } from \"@wordpress/element\";\nimport { decodeEntities } from \"@wordpress/html-entities\";\nimport OptionsSelectControl from \"./OptionsSelectControl\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { relatedPostId, postType } = attributes;\n\n\tlet currentRelatedPost = useSelect(\n\t\t(select) =>\n\t\t\trelatedPostId && postType\n\t\t\t\t? select(\"core\").getEntityRecord(\"postType\", postType, relatedPostId)\n\t\t\t\t: null,\n\t\t[relatedPostId, postType],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t \n\n\t\t\t\n\t\t\t\t{!relatedPostId && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{__(\n\t\t\t\t\t\t\t\t\"Ce bloc n'est relié à aucune question. Rattachez-le à une fiche question dans la barre latérale.\",\n\t\t\t\t\t\t\t\t\"homegrade-blocks__texte-backoffice\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t
\n\t\t\t\t\t>\n\t\t\t\t)}\n\n\t\t\t\t{currentRelatedPost &&\n\t\t\t\t\tcurrentRelatedPost.content &&\n\t\t\t\t\tcurrentRelatedPost.title && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{decodeEntities(currentRelatedPost.title.rendered)} \n\t\t\t\t\t\t\t{currentRelatedPost.content.rendered} \n\t\t\t\t\t\t>\n\t\t\t\t\t)}\n\t\t\t \n\t\t>\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\nimport transforms from \"./transforms\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\n\tedit: Edit,\n\ttransforms: transforms,\n});\n","import { createBlock } from \"@wordpress/blocks\";\r\n\r\nconst transforms = {\r\n\tto: [\r\n\t\t/* supported to transforms */\r\n\t],\r\n\tfrom: [\r\n\t\t{\r\n\t\t\ttype: \"block\",\r\n\t\t\tblocks: [\"homegrade-content-blocks/questions-container\"],\r\n\t\t\ttransform: ({ relatedPostId }) => {\r\n\t\t\t\treturn createBlock(\"homegrade-content-blocks/post-content-container\", {\r\n\t\t\t\t\trelatedPostId,\r\n\t\t\t\t\tpostType: \"questions\",\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\ttype: \"block\",\r\n\t\t\tblocks: [\"core/paragraph\"],\r\n\t\t\ttransform: () => {\r\n\t\t\t\treturn createBlock(\"homegrade-content-blocks/post-content-container\");\r\n\t\t\t},\r\n\t\t},\r\n\t],\r\n};\r\n\r\nexport default transforms;\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"htmlEntities\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","InspectorControls","PanelBody","SelectControl","ComboboxControl","Tip","useSelect","useEffect","useState","decodeEntities","OptionsSelectControl","setAttributes","relatedPostId","postType","createElement","postOptions","setPostOptions","lang","getAdminLanguageFromCookie","optionPages","select","query","status","per_page","getEntityRecords","editUrl","window","location","origin","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring","handleRelatedPostChange","postId","Number","handlePostTypeChange","buildSelectOptions","options","push","value","label","forEach","page","id","title","rendered","panelTitle","onChange","e","href","className","useBlockProps","RawHTML","Edit","attributes","currentRelatedPost","getEntityRecord","Fragment","content","registerBlockType","metadata","transforms","name","icon","src","xmlns","width","height","viewBox","class","d","foreground","edit","createBlock","to","from","type","blocks","transform"],"sourceRoot":""}
\ No newline at end of file
diff --git a/blocks/post-content-container/build/render.php b/blocks/post-content-container/build/render.php
index 87d78b6..5f1f772 100644
--- a/blocks/post-content-container/build/render.php
+++ b/blocks/post-content-container/build/render.php
@@ -2,10 +2,24 @@
$relatedPostId = $attributes['relatedPostId'] ?? null;
$relatedPost = get_post($relatedPostId);
$anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : "post-content-container-" . $relatedPostId;
+$content = get_the_content(null, null, $relatedPost);
+
+if ($relatedPost) {
+ // Temporarily set up the global post variable so the_content works as expected
+ global $post;
+ $post = $relatedPost;
+ setup_postdata($post);
+
+ ob_start();
+ the_content();
+ $content = ob_get_clean();
+ wp_reset_postdata();
+}
?>
+
">
post_title ?>
- post_content ?>
+
\ No newline at end of file
diff --git a/blocks/post-content-container/src/render.php b/blocks/post-content-container/src/render.php
index 87d78b6..5f1f772 100644
--- a/blocks/post-content-container/src/render.php
+++ b/blocks/post-content-container/src/render.php
@@ -2,10 +2,24 @@
$relatedPostId = $attributes['relatedPostId'] ?? null;
$relatedPost = get_post($relatedPostId);
$anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : "post-content-container-" . $relatedPostId;
+$content = get_the_content(null, null, $relatedPost);
+
+if ($relatedPost) {
+ // Temporarily set up the global post variable so the_content works as expected
+ global $post;
+ $post = $relatedPost;
+ setup_postdata($post);
+
+ ob_start();
+ the_content();
+ $content = ob_get_clean();
+ wp_reset_postdata();
+}
?>
+
">
post_title ?>
- post_content ?>
+
\ No newline at end of file