Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
register template part variations server side. #31761
register template part variations server side. #31761
Changes from all commits
64bbb36
8d2fbae
2360ad3
b99b59d
ba6c893
4c10d79
ee9aa69
cd2dd76
1f1264d
ff7852f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should we check
icons[ variation.icon ] || set the TP default icon
? Thetypeof === 'string'
can be omitted.Also related to that, should we just create a mapper object that would contain the
header
andfooter
icons to avoid importing all the icons and would default tolayout
? --cc @gzioloThere 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.
That all makes sense.
I was wondering if maybe there was a way someone could have registered it with an actual icon instead of an icon name, and to just double check if it was a simple string at this point before trying to overwrite it.
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.
Yeah, I'l go ahead and limit this to just importing the icons we expect for template parts at this time (header, footer, sidebar, and layout).
It would be neat if in the future we could enable registering custom icons with a template part area. Its no requirement at this point, but if instead of defining
'icon' => 'icon_name'
on the php side we could define'icon' => $some_icon
. But I'm currently drawing a blank on how one might go about that.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.
I was planning on exploring allowing icons to be set with svg strings, but the tricky part is finding a solution that will also work with react native
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.
@gwwar that would be neat! Im not too familiar with native's limitations there.