-
Notifications
You must be signed in to change notification settings - Fork 5
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
Tutorial: Create, Rename and Reorder Block Categories #343
Comments
@troychaplin The Snippet format is not yet particular finalized as we just started working on it, but it's meant to cover a single purpose/task, people might want to do. Also cc: @justintadlock to assist. |
Thanks @bph, I'm gonna work out the individual functions as I want a reorder function for another project but don't need the renaming. If @justintadlock would prefer them as individual functions I'll be prepared for that. Personally, I think it might be best as 2 functions. I could see reordering being desired more than renaming. |
@justintadlock what's your opinion on one large function vs individual functions. I did a bit of work on these and ended up keeping the one function for my own personal use as it will register, reorder or rename all in one, it's just easier as an all-in-one. |
The first draft of this snippet is ready for review -- https://docs.google.com/document/d/1g0ROKi6pUIScCVgMjI1j4TWV1S3BmQJxGOllEhxsaiI/edit?tab=t.0 |
Hey @troychaplin, @bph asked me to review the snippet. So, my first thought is that this would indeed make more sense as a developer blog post, mostly because it's a cool example of a real-world solution to a problem: adding categories, renaming existing categories, and then reordering them to meet client requirements. Additionally, there's some fun PHP-related learning in there (altering array elements inside the My suggestion would be to rework this as a developer blog post, with (more or less) the following rough outline:
Along the way, share info on all the other PHP-related things I mentioned above. Alternatively, if you want to stick to snippets, I'd suggest turning this into three distinct snippets:
Although I'd much prefer it if you went with the dev blog post 😁 That having been said, maybe you could do both? Start with the three snippets, and then from there create the blog post in the new year? Last note: For the developer blog, we tend to be sticklers for following WordPress Coding Standards to the letter (even though some folks out there don't use/like them). To make life easier, I'll share the WPCS formatted version below.
I also suggest two additional changes:
|
This would be a very valuable blog post as Jonathan has detailed. Could we still use the headings Jonathan suggests if it becomes a blog post as these are good searchable references. I wonder from the discussion and looking at other snippets and a couple of blog posts, whether we have other content that could have snippets extracted easily from them too. This is wider than this current discussion, so will collate some examples and add it to a GitHub discussion if further exploration shows some value. |
Thanks for the feedback @jonathanbossenger and @abhansnuk. Sounds like there would be an appetite for a larger article here. I would be happy to set aside some time to expand upon this. @bph I know this was approved as a snippet, is there any process to approve this as a full article before I look at building this one out further? |
@jonathanbossenger those standards get me every time. I do review and updated them in the end, I must have had my auto format turned on. I have to fix some settings in VSCode to easily switch between PSR2 and WPCS when needed. |
@troychaplin no worries, I have the same issue when switching between projects 😁 |
@troychaplin The topic was approved. Its status doesn't change because of the format changes. It is in the discretion of the writers and the reviewers to decide on the format if the topic is still the same. We just need to remove the "Snippet:" prefix in the issue title and remove the label |
Thanks @bph, I thought that might be the case. Looking forward to diving into this on more very soon! |
Moved back to |
Discussed in #340
Originally posted by troychaplin November 15, 2024
This snippet provides an example of a function to reorder and/or customize the title of the core or custom block categories. In this example the following modifications are happening:
The text was updated successfully, but these errors were encountered: