Mô tả

Recently WordPress decided to change their old WYSIWYG editor into a new ReactJS based block editor known as 'Gutenberg'. Gutenberg also known as the block editor is based on blocks. So your post will be composed of some blocks and each block will have a purpose. You can have a block that displays a button or an image or some text and so on. 

In this course you will learn everything you need to know in order to create custom blocks for the block editor. We will start by a simple block and then we will create some more complex blocks.

In order to gain the most out of this course you need to have WordPress theme/plugin development knowledge. Javascript knowledge is required for this course. You should be familiar with basic JavaScript concepts and preferably the recent ES6+ versions. ReactJS knowledge is also required for this course. So concepts like component state, hooks and basic react concepts should not be new to you. Also advanced concepts like higher order component knowledge would be ideal however it will be discussed briefly in the course. Redux knowledge is also ideal. Not all blocks will require using redux, however in some blocks we will use redux heavily. So it would be ideal if you are familiar with redux concepts like stores, actions, reducers and so on.

The course content will go as follows:

  • First and before any coding we will discuss some design guidelines that you should follow when designing a block.

  • We will take a look on how your Gutenberg post is saved in your database and what happens behind the scenes in order to construct your ReactJS based UI from the content saved in the database.

  • In Section 2, we will create a WordPress plugin. Inside this plugin we will register out first Gutenberg block. We will also use a tool provided by WordPress called wp-scripts in order to process JS and CSS files in this plugin. We will also integrate tools like ESLint, Prettier, Stylelint and Husky for an improved development workflow.

  • In section 3, we will take a quick look on some stuff that you can do in your WordPress theme that will allow you to modify/add some features in the block editor.

  • In section 4 we will create a simple block. However in this simple block we will learn a lot about what we can do in a block.

  • In section 5 we will use our knowledge to create a more complex block with some advanced features. These features include how to add blocks inside of other blocks, how to handle images and many more.

  • Section 6 will be about creating dynamic blocks. So blocks can be static or in other words only generate some static HTML. But also they can be dynamic for example they can fetch something from the database.

  • Section 7 will discover more about the redux-like data stores in the block editor. We will see how to use the existing data stores and also create our own store.

  • Section 8 we will see different ways that we can follow in order to manage metadata in Gutenberg. We will manage metadata using a block. And we will also learn how to create a custom sidebar plugin and manage metadata in this sidebar.

  • In the final section we are going to discuss various topics like: context, patterns, templates, formatting API, filters and internationalization.


Bạn sẽ học được gì

Learn about the block editor design guidelines.

Discover how the block editor saves your post in the database and how the editor UI is constructed.

Learn how to use wp-scripts to transpile ES6 and JSX, compile SASS to CSS, bundle and minify your JS and CSS files and more.

Integrate ESLint, Prettier, Stylelint and Husky in your project to improve your workflow.

Create a new custom Gutenberg block from scratch.

Customize the block editor features in your WordPress theme.

Discover every aspect you need to know to create a complex Gutenberg block.

Create a nested block (a block that accepts other blocks inside of it).

Use third party react libraries to create complex features.

Learn about handling deprecated blocks.

Learn how to transform your custom block into another block.

Create a dynamic block.

Explore how to use the existing data stores in your blocks.

Learn how to create your own data stores stores in order to share data between blocks.

Learn different ways to manage meta fields in the block editor.

Learn how to create a custom sidebar in the block editor and manage your meta fields inside of it.

Learn how to extend the existing block editor's sidebar.

Learn about features like patterns, context, formatting API and templates.

Modify existing block's behavior with JavaScript & PHP filters.

Internationalize blocks by generating and loading translation files.

Yêu cầu

  • You should be familiar with HTML, CSS (SASS), Javascript and PHP basics.
  • You should be familiar with WordPress development.
  • You should be familiar with ReactJS Basic Concepts.
  • Redux Knowledge is Preferable
  • Any code editor you are comfortable with, I will use VS Code in this code.
  • A local server like MAMP, WAMP, XAMPP, Laragon or any other software you are familiar with. I will use MAMP through out this course.
  • NodeJS and NPM or Yarn installed on your machine.

Nội dung khoá học

10 sections

An Introduction to the Block Editor

8 lectures
Before Watching the Course
03:33
Installing a Starter WordPress Theme
05:00
The Block Editor Interface
02:41
The Block Interface & Design Guidelines
11:40
How is a Post in the Block Editor Saved in the Database
05:17
How the Visual Editor is Reconstructed From Plain HTML
03:52
A Brief Introduction to the Redux-like Data Stores in the Block Editor
08:41
The Post State Array in Action
09:05

Let's Create our First Block

9 lectures
Creating a New WordPress Plugin
03:06
Registering our First Block
11:59
Returning React Components in the Edit & Save Functions
05:14
Compiling ESNext to ES5 with wp-scripts
13:03
Compiling & Loading SASS Files
16:22
Generating a Block with @wordpress/create-block
09:36
Configuring ESLint & Prettier for JavaScript Files
08:55
Configuring Stylelint for Linting our SCSS Files
08:21
Adding a Pre-commit Git Hook with Husky
09:39

Adding Theme Support for the Block Editor

5 lectures
Adding Custom Styles to the Block Editor
09:10
Adding Support for Align Wide and Align Full
12:28
Adding Custom Colour Pallets
10:02
Adding Custom Font Sizes
04:09
Custom Sizing & Custom Units
02:59

Exploring Block Features by Creating a Simple Block

17 lectures
Creating a New Clone from our Boilerplate Properly
04:42
Editing the Boilerplate's Metadata
05:04
Customizing the Block's Icon
03:03
The RichText Component
17:18
Adding Options in the Block Toolbar Using BlockControls
14:35
The AlignmentToolbar Component
10:25
Adding Options in the Sidebar Using InspectorControls
10:13
Adding an Option to Change the Background and Text Colours
11:29
Using the withColors Higher Order Component
21:47
Changing the Background and Text Colours using Block Supports
10:47
Adding an Option to Change the Block's Padding
16:20
Adding an Option for toggling Box Shadow
12:40
Adding Support for Different Style Options
03:25
Examples & Variations
05:28
Transforming Blocks into Other Blocks
11:30
Adding Deprecated Versions for our Block
09:45
Adding Deprecated Versions for our Block (Part. 2)
10:04

Let's Create a Complex Nested Block!

35 lectures
Block Overview
02:31
Initializing a New Plugin for Our Block
03:31
Editing the Boilerplate's Metadata
04:21
Using InnerBlocks to Create a Nested Block
06:17
Registering the Team Member Block
05:26
Creating the edit and save functions for the name and bio
12:11
Adding templates for our team members
04:26
Adding an option for changing the number of columns
08:37
Styling the Front-end of the Block
08:53
Adding the Editor Styles for our Block
14:38
Introducing the ImagePlaceholder Component
08:31
Storing & Displaying the Team Member Image
13:18
Handiling Inserting an Image from an External URL
01:52
Displaying Image Related Errors
05:23
Displaying the Image in the Save Function (Front-end)
05:09
Blob URL Edge Case & Memory Optimization
08:42
Replacing the Image with a Toolbar Option
05:19
Removing the Image with a Toolbar Option
02:41
Adding a Sidebar Option to Modify the Alt Text of the Image
06:08
Adding an Option for Changing the Image Size
20:24
Focusing on the Name Input After Selecting an Image
05:50
Adding Alignment Options for the Team Members Block
01:29
Adding & Displaying an Attribute for the Social Links
09:55
Styling the Social Links for the Editor Page
04:38
Selected Link State & Styling
06:47
Adding New Items to the Social Links
04:01
The Save Function Markup for the Social Links
05:41
Extracting the Social Links Array from the HTML to Improve Efficiency
06:42
Adding the Markup for the Edit Link Form
06:05
Editing the Social Media Links & Icons
05:04
Removing Social Links
05:19
Making our Social Links Sortable (Part. 1)
16:44
Making our Social Links Sortable (Part. 2)
15:52
Adding an Example for the Block Preview
07:09
Adding Transformations for the Team Members Block
12:27

Dynamic Blocks

11 lectures
Introduction to Dynamic Blocks
03:01
Initializing our Latest Posts Block
03:01
Editing the Boilerplate's Metadata
04:10
Displaying Dynamic Content in the Front-end
04:54
Displaying the Latest Posts in the Frond-end Using PHP
15:35
Preparing Our Data for the Editor Loop
07:49
Displaying the Latest Posts in the Editor
15:36
Styling the Posts in the Editor and Front-end
05:40
Adding Options for Number of Posts and Featured Image
09:25
Adding an Option for Changing the Order of the Posts
05:16
Filtering Posts by Categories
22:49

Creating a Plugin Boilerplate for Block Editor Features

3 lectures
Quick Note!
00:18
Creating a New Plugin Boilerplate for the Block Editor
11:59
Integrating wp-scripts in our Boilerplate
11:56

Adding Custom Global Data Stores

11 lectures
The Core Data Stores
11:06
Using the Data Stored Inside the Blocks
09:19
Todos Store Overview
06:55
Registering a Custom Store
18:24
Populating Our Store Data from an external API
16:23
Handling API Errors
05:46
Displaying the Todos in the Todo List Block
09:25
Adding a Form for Adding New Todos
07:41
Using the API to Add New Todos
10:14
Using the API to Toggle the Todos
14:16
Creating the Todo List Info Block
08:06

Managing Metadata & Adding Custom Sidebars

6 lectures
The Old PHP Way of Managing Metadata
09:45
Manipulating Meta Fields Using the Data Stores
07:50
Managing Meta Fields Using Blocks
13:44
Adding a Custom Sidebar using Plugins
05:56
Customizing the Existing Editor UI
06:47
Adding an Option to Edit Meta Fields in the Sidebar
06:29

Bonus Lectures

8 lectures
Passing Attributes from Parent to Child using Context
04:15
Adding Predefined Templates for Post Types
06:56
Adding Predefined Block Patterns
08:10
Using the Formatting API to add New Text Formats
08:47
Modifying Existing Behaviour with PHP Filters
11:07
Modifying Existing Behaviour with JavaScript Filters
11:37
Internationalization - Generating & Loading Translation FIles
19:54
BONUS LECTURE
00:11

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.