WordPress Gutenberg marks big shift away from TinyMCE towards WYSIWYG way of building pages and writing posts. let's walk through the elements of blocks WordPress user can interact with. In this example, field where user can add URL of Github gist, to embed it in post.. With Gutenberg, we can hook loading the frontend resources into the enqueue block assets hook on the frontend and enqueue block editor assets in the backend. 3 blocks js. It uses registerBlockType from Block API to create the element with its save and edit functions. We'll add interface to the editor that lets the user add link to Github gist they want to embed. One of the key changes that Gutenberg brings to WordPress ecosystem is heavy reliance on JavaScript... In this section, we're loading support for internationalization, registerBlockType and PlainText from the global wp object.. In the element, we're specifying the input of Gutenberg block, specifically the naming and formatting. We'll later use the gist url variable to store URL, to display it in the backend and to render the embed code for the Gist in the frontend..
Read more