-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experiment/add custom connections inspector control #53241
Experiment/add custom connections inspector control #53241
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/experimental/editor-settings.php ❔ lib/experiments-page.php |
Size Change: +373 B (0%) Total Size: 1.5 MB
ℹ️ View Unchanged
|
Flaky tests detected in 8638dff. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5741859332
|
Setting the PR as ready for review to not block @michalczaplinski work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
I cannot approve my own PR but I checked latest @michalczaplinski changes and look good to me. Thanks! |
// of the paragraph block and the `url` attribute of the image block are supported. | ||
let attributeName; | ||
if ( props.name === 'core/paragraph' ) attributeName = 'content'; | ||
if ( props.name === 'core/image' ) attributeName = 'url'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use "block.json" support config instead of hardcoding these. Also the same block can have multiple connected attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this should come from the attribute "connection", it should tell which attribute to connect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this should come from the attribute "connection", it should tell which attribute to connect.
Yes! This is just for the first version where we want to support only the url
of the image and the content
content of the paragraph.
We'll need a different UI here to support connecting multiple attributes per block.
And in general, we'll probably need a different UI altogether for this soon to include searching for custom fields, adding new ones, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add me as a reviewer to PRs involving custom fields please. I might not chime in in all of them but I'm interested in following. (If possible ofc)
Just thinking about the general API design: "content": {
"source": "meta_fields",
"value": "custom_field_meta"
} I'm wondering if As we start to code I feel this might get a bit confusing if it ends up as something like |
What?
TBD. I created the PR in case anyone needs to keep working on it.
POC of having a connections attribute that links external or internal sources with blocks, that will be replaced in the frontend by the HTML API.
Now creates this block attributes structure:
Screenshots or screencast