How to Build Dynamic (PHP) Blocks in WordPress

Ғылым және технология

Let's build a dynamic block for WordPress. Along the way we'll discuss the difference between static and dynamic blocks, when to use them, WP_Query, what ServerSideRender is and what the best approach for performance is.
🚨 Free Video Series: 7 Tools for Modern WordPress Development 🚨
👉 briancoords.com/7tools
👉 Code Repository: github.com/bacoords/example-d...
👉 Blog Post: www.briancoords.com/how-to-bu...
More Reading:
👉 Rest API Handbook: developer.wordpress.org/rest-...
👉 Static vs Dynamic Rendering: developer.wordpress.org/block...
👉 Static vs Dynamic Blocks: developer.wordpress.org/news/...
Chapters:
00:00:00 Dynamic vs Static Blocks
00:02:26 Scaffold with Create-Block
00:03:36 Block Plugin Structure and Build Process
00:04:07 Block.json
00:07:03 Index.js
00:08:01 Edit.js - Adding Inspector Controls
00:12:34 Render.php
00:16:26 Adding CSS in Style.scss
00:17:48 The ServerSideRender Component
00:22:10 Edit.js - Building the block with core-data
00:25:32 Data from WP REST API vs WP_Query

Пікірлер: 47

    Келесі