Commit 406fba2 1 parent db619bd commit 406fba2 Copy full SHA for 406fba2
File tree 2 files changed +28
-7
lines changed
2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 1
- # Data Types with post_content and post meta
1
+ # Data Types with content areas
2
2
3
- ` npm install ` and ` npm run dev-server `
3
+ Run it with ` npm install ` and ` npm run dev-server ` .
4
4
5
- ### TODO
5
+ ## How it works
6
6
7
- - [ ] Document stuff better and show teammates
8
- - [ ] Lock all content and styling except bound blocks's inside when entering data
9
- - [ ] Work on examples that have a primary and secondary content
7
+ ### Creating a data type
8
+
9
+ Much like the Hackathon, the Editor creates a new post type and define the fields.
10
+
11
+ The "fields" in this prototype are limited to the content areas.
12
+
13
+ When you select a Group block, a new inspector control ("Content area") is added to the sidebar,
14
+ where you can bind the contents to a specific part of the post object.
15
+
16
+ - ` post_content ` binds to the ` post_content ` attribute.
17
+ - Any other value binds to the post meta fields.
18
+
19
+ ### Entering data
20
+
21
+ The data type template and displayed in the Editor. User enters content in the group blocks that were added.
22
+
23
+ Upon clicking "Save", the back-end will intercept the post, extract the bound Group's contents and
24
+ route them to the appropriate places.
25
+
26
+ ### Displaying data
27
+
28
+ The ` post_content ` is not intercepted, and the stored content is displayed.
29
+
30
+ The plugin creates a block variation for each post meta field, and also exposes a block that renders the data type template.
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function registerContentAreaInspector( wp ) {
23
23
wp . element . createElement (
24
24
PanelBody ,
25
25
{
26
- title : 'Content Area ' ,
26
+ title : 'Content area ' ,
27
27
initialOpen : true ,
28
28
} ,
29
29
[
You can’t perform that action at this time.
0 commit comments