{"id":3616,"date":"2022-09-09T14:47:27","date_gmt":"2022-09-09T11:47:27","guid":{"rendered":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/?post_type=wz_knowledgebase&#038;p=3616"},"modified":"2022-09-20T19:56:34","modified_gmt":"2022-09-20T16:56:34","slug":"wordpress-6-0-block-editor-tips-and-tricks","status":"publish","type":"wz_knowledgebase","link":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wikipage\/wordpress-6-0-block-editor-tips-and-tricks\/","title":{"rendered":"WordPress 6.0 Block Editor Tips and Tricks"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Technology overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress block editor (code named and also generally known as &#8220;Gutenberg&#8221;) is the largest change in WordPress ecosystem since it&#8217;s inception and was released as a WordPress Core feature in 2018 bringing modern React \/ Redux based Web UI layer in place of the old fashioned and ugly, but so far highly popular PHP  templating system and CMS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Block editor is built from the grown up to being highly modular and modern WYSIWYG editor and to compete and deprecate the tried and true <a href=\"https:\/\/github.com\/tinymce\/tinymce\">TinyMCE editor<\/a> which is the &#8220;rich text editor box&#8221; used in many parts around web and has even been powering the legacy WordPress &#8220;classic editor&#8221; experience for ages. WordPress being GPLv2+ licensed and restricting it&#8217;s proprietary use, the Gutenberg project is working on dual-licensing the code with GPLv2+ and a MIT style MPL 2.0 model for breaking later also into proprietary systems space as TinyMCE did. More about the ongoing license discussions and progress in an <a href=\"https:\/\/github.com\/WordPress\/gutenberg\/issues\/23651\">open GitHub issue<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Block Editor is a heavy SPA application and there&#8217;s performance optimization to be done in it while features are being constantly added. As a single thread application it benefits from high CPU single core performance where something like an Intel i3 and 8 GB of system ram would be a bare minimum when running on any mainstream grafical operating system. Cross-browser support is good with mainstream browsers such as Firefox, Safari and Chromium, while mobile responsivity is optimized for the best end user experience. The development tools and API&#8217;s for are considered  being pretty stable. While depending on NPM, Webpack, React and the ES6\/Javascript2015 transpiling workflow, the official &#8220;best practices&#8221; are available in <a href=\"https:\/\/www.npmjs.com\/package\/@wordpress\/create-block\">NPM package repository @wordpress\/create-block<\/a> and WordPress data objects have compatibility layer built on top of underlying frameworks that may change over time (such as Redux).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Block editor uses the WordPress PHP application through extendable <a href=\"https:\/\/developer.wordpress.org\/rest-api\/\">WordPress REST API<\/a>. A couple development server options include open source <a href=\"https:\/\/developer.wordpress.org\/rest-api\/\">Virtualbox\/Vagrant\/AMD64 Ubuntu Box based VVV<\/a>, and a free but proprietary and more plug and play XAMP based alternative <a href=\"https:\/\/localwp.com\/\">&#8220;Local&#8221;<\/a> which also support for ARM processors which is something being worked on in VVV that currently runs on new Macs only through Parallels Pro requiring a paid ($120\/year) license. Both support XDebug out of the box, and Local has plug and play launch.json VSCode configuration generator for it&#8217;s PHP Debug extension.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While this article is not intended being a complete introduction into WordPress Block Editor development, here&#8217;s some recommended sources for diving deeper while the rest of the article is covering some useful tips and tricks for content editors or the regular WordPress users.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Advanced technical tutorial for existing JavaScript\/React developers: <a href=\"https:\/\/unfoldingneurons.com\/2020\/wordpress-data-series-overview-and-introduction\">https:\/\/unfoldingneurons.com\/2020\/wordpress-data-series-overview-and-introduction<\/a><\/li><li>In depth Udemy course aimed for developers new in JavaScript and\/or WordPress covering the whole process of building dynamic block editor extensions and blocks <a href=\"https:\/\/www.udemy.com\/course\/gutenberg\/\">https:\/\/www.udemy.com\/course\/gutenberg\/<\/a><\/li><li>More links about topic by <a href=\"https:\/\/www.diigo.com\/user\/jasalt\/gutenberg\">https:\/\/www.diigo.com\/user\/jasalt\/gutenberg<\/a><\/li><\/ul>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\"><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Tips and tricks<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Markdown text can be pasted into the editor and it is converted into block editor elements. Helps some writers having problems with the editor.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/wp-content\/uploads\/2022\/09\/image.png\" alt=\"\" class=\"wp-image-3618\" width=\"458\" height=\"299\" srcset=\"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/wp-content\/uploads\/2022\/09\/image.png 748w, https:\/\/xn--jyvskyl-7wae.hacklab.fi\/wp-content\/uploads\/2022\/09\/image-300x196.png 300w, https:\/\/xn--jyvskyl-7wae.hacklab.fi\/wp-content\/uploads\/2022\/09\/image-540x352.png 540w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><figcaption>List View is highly useful while working with complex document structure<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">More tips: <a href=\"https:\/\/www.gsarigiannidis.gr\/gutenberg-tips-to-forget-the-classic-editor\/\">https:\/\/www.gsarigiannidis.gr\/gutenberg-tips-to-forget-the-classic-editor\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cool Example blocks<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">3D block<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/srd.wordpress.org\/plugins\/a8c-3d-model-viewer\/\">&#8220;3D model&#8221; block<\/a> by WordPress developer company Automattic  is installed currently which supports GLB format with a nice drag and drop interface. Here is a demo with a model from <a href=\"https:\/\/3d.si.edu\/\">https:\/\/3d.si.edu\/<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-a8c-model-viewer\"><model-viewer class=\"wp-block-a8c-model-viewer__component\" style=\"height:654px;width:100%\" alt=\"\" src=\"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/wp-content\/uploads\/2022\/09\/Orbiter_Space_Shuttle_OV-103_Discovery-150k-4096.glb\" ar=\"true\" camera-orbit=\"0rad 1.3089969389957472rad 82.19356365563067m\" field-of-view=\"30.000000000000004\" ar-modes=\"webxr scene-viewer quick-look\" seamless-poster=\"true\" shadow-intensity=\"1\" camera-controls=\"true\" enable-pan=\"true\"><\/model-viewer><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>HUOMIO<\/p><cite>T\u00e4m\u00e4 artikkeli on nys\u00e4. Voit jatkaa sen editointia, tai poistaa sen jos tieto on jo vanhentunutta.<\/cite><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>New and headless start into playing with WordPress with JavaScript\/ES6 and React.<\/p>\n","protected":false},"author":26,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"wzkb_product":[],"wzkb_category":[],"wzkb_tag":[],"class_list":["post-3616","wz_knowledgebase","type-wz_knowledgebase","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wz_knowledgebase\/3616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wz_knowledgebase"}],"about":[{"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/types\/wz_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/comments?post=3616"}],"version-history":[{"count":9,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wz_knowledgebase\/3616\/revisions"}],"predecessor-version":[{"id":4010,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wz_knowledgebase\/3616\/revisions\/4010"}],"wp:attachment":[{"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/media?parent=3616"}],"wp:term":[{"taxonomy":"wzkb_product","embeddable":true,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wzkb_product?post=3616"},{"taxonomy":"wzkb_category","embeddable":true,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wzkb_category?post=3616"},{"taxonomy":"wzkb_tag","embeddable":true,"href":"https:\/\/xn--jyvskyl-7wae.hacklab.fi\/en\/wp-json\/wp\/v2\/wzkb_tag?post=3616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}