Skip to content
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

Prepare for new block variations 1/x: hookable-patterns, slot-fills & docs #888

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

carstingaxion
Copy link
Collaborator

@carstingaxion carstingaxion commented Sep 19, 2024

Preparation to bring some block variations from the gatherpress-block-playground into the plugin as part of #626.

Description of the Change

This PR does:

  1. Bring hookable block-patterns into place (as preparation, still disabled)
  2. Import PluginDocumentSettingPanel from wordpress/editor package (The former source was deprecated in 6.6, which led to the annoying console warnings all over the place)
  3. Introduce new slots inside the document sidebar for event & venue post type
  4. add new /docs/developer/blocks/...

Closes #628

How to test the Change

Changelog Entry

Added - Extendable infrastructure for future blocks

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@carstingaxion carstingaxion changed the title Prepare for new block variations Prepare for new block variations 1/x Sep 19, 2024
@carstingaxion carstingaxion marked this pull request as ready for review September 19, 2024 02:42
@carstingaxion carstingaxion changed the title Prepare for new block variations 1/x Prepare for new block variations 1/x: hookable-patterns slot-fills & docs Sep 19, 2024
@carstingaxion carstingaxion mentioned this pull request Sep 19, 2024
62 tasks
@carstingaxion carstingaxion changed the title Prepare for new block variations 1/x: hookable-patterns slot-fills & docs Prepare for new block variations 1/x: hookable-patterns, slot-fills & docs Sep 19, 2024
includes/core/classes/class-block.php Outdated Show resolved Hide resolved
\register_block_pattern(
'gatherpress/event-template',
array(
'title' => 'Invisible Event Template Block Pattern',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs internationalization __().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little funny.

  1. I had _() everywhere in place
  2. Than realised, that nobody will ever see this. Because it's hidden. So I removed the _() and added a comment "// Needs no i18n
  3. Lastly I removed the comment also, because .... I don't know.

Now I'm going to add _() again, yes.

* when registering the 'gatherpress_event' post type
* and will not be visible to the editor at any point.
*/
\register_block_pattern(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need \

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be fixed, but I'm wondering why the CS checks didn't jump in here. Some days ago, I remember that phpcs was jelling at me because of a \WP_Query. But here, nothing. Hmmm.

includes/core/classes/class-block.php Outdated Show resolved Hide resolved
includes/core/classes/class-block.php Outdated Show resolved Hide resolved
includes/core/classes/class-block.php Outdated Show resolved Hide resolved
includes/core/classes/class-block.php Outdated Show resolved Hide resolved
@carstingaxion
Copy link
Collaborator Author

Finished, but mention the two unresolved comments, please @mauteri .

Copy link

Preview changes with Playground

You can preview the recent changes for PR#888 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

General changes to post type registrations and registration of two new invisible patterns
2 participants