Closed bobbingwide closed 2 years ago
The current state of the Person block is as these screenshots.
For edit
and save
I've set the key=
property to avoid getting the particularly unhelpful message
Warning: Each child in an array or iterator should have a unique "key" prop.
See https://fb.me/react-warning-keys for more information.
I've read the help multiple times but it really doesn't give any indication how to perform problem determination using Developer tools. There must be a rite of passage that I've not been prepared for.
How do I identify which controls need key=
fields and which don't?
Note: Setting multiple key=
fields with the same value does at least produce a slightly more useful message.
Warning: Encountered two children with the same key, `perinspector`.
Keys should be unique so that components maintain their identity across updates.
Non-unique keys may cause children to be duplicated and/or omitted
— the behavior is unsupported and could change in a future version.
Perhaps there could be some provision in core for the commonly used tags.
It’s time to change this block to a server side rendered function that under the covers will use the shortcode functions. There is already an example of using the bw_user shortcode to display an author box with gravatar,about,bio
and a class of author-box
.
The block should optionally include the Follow me block as a child element.
The trouble with having the follow me
block as a child element is that nested blocks do not automatically inherit attributes of the parent block. So the user=
attribute would need to be set for both the Person
block and the child follow me
block.
follow_me
fieldLatest example in the block editor, showing the equivalent shortcode and the rendered output.
Create a block displaying details of a person / user with contact information
The Person block will work with the
oik-user
plugin to display information about a particular user. It will combine a set of shortcodes into a single block.Initial version
Block to be the equivalent of
where
abc
is the user name or ID entered in the Advanced Settings User field.Subsequent versions