Attributes: what do the source and selector properties do? #138
Replies: 3 comments
-
Sounds like a good topic, @mburridge. We could definitely use a post exploring this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The topic has been approved. The discussion is now locked, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Now published: https://developer.wordpress.org/news/2023/09/understanding-block-attributes/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Block attributes are typically stored in the comment delimiter, and the values are fetched from there when the block is parsed to be displayed in the editor. But did you know that attribute values can also be stored in the block content? You can use the
source
andselector
properties to determine where in the saved block the attribute values are fetched from at parse time.This post will be an introduction to using and saving attributes - basically a friendlier and more tutorial-based version of the content in the Attributes page in the handbook, and with more examples.
Beta Was this translation helpful? Give feedback.
All reactions