-
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
Add PascalCase slug to create-block template strings #35462
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @opr! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
I'm not sure if I'll need to update the changelog and package versions in this PR, or if this will be done as a next step when releasing the package. If it's required now then please let me know and I'll add 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.
This looks good, thank you for the contribution.
Yes, you do need to update the CHANGELOG under the ## Unreleased
section. Since it looks like there is not anything added yet. Add a subsection ### New Features
and your update.
You do not need to update version numbers, that is handled by the release process.
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 the update, I made a minor change to use the precise name for the variable.
Thanks for the review and thanks for updating that, I appreciate it. |
Congratulations on your first merged pull request, @opr! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
Description
This PR will make a new token available to the templated files used with
@wordpress/create-block
. It will allow templates to replace{{slugPascalCase}}
with the extension's slug but in PascalCase.This could be useful in cases where templates generate classes, These should be written in PascalCase, and currently there's no way to do this.
How has this been tested?
I have created an example template package, (https://www.npmjs.com/package/blocks-template) the repo for this package is here: https://github.com/opr/blocks-template/ and the
slugPascalCase
is used in the$slug.php.mustache
file.From the root of this repo:
npx wp-create-block -t blocks-template my-test-extension
.my-test-extension
and viewmy-test-extension.php
MyTestExtension_Blocks_Integration
Types of changes
New feature to the
create-block
package.Checklist: