-
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
Docs: Transforms - file and priority example #8076
Conversation
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.
Looks good, just a couple of minor changes.
I wonder if it's also worth mentioning that file transforms can only be used as 'from' transforms. Might be too obvious and implied by the examples to warrant mentioning.
docs/block-api.md
Outdated
{ | ||
type: 'files', | ||
isMatch: function ( files ) { | ||
return files.length === 1 |
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.
missing semi-colon
docs/block-api.md
Outdated
@@ -310,6 +310,63 @@ transforms: { | |||
|
|||
To control the priority with which a transform is applied, define a `priority` numeric property on your transform object, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set. | |||
|
|||
A file can be dropped into the editor and transformed into a (specific) file block. |
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.
The use of 'file block' here might be confusing. Maybe just "A file can be dropped into the editor and converted into a block with a matching transform"
@talldan Thanks for your review, I updated the PR. I don't think we have to mention the |
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.
Thanks for making the change, I'm happy 👍
Description
A dropped file can be transformed into a block. I added the information and an example for the usage of
files
andpriority
.