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

Patterns: Register new media related categories #55236

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

aaronrobertshaw
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw commented Oct 11, 2023

Related:

What?

Adds new media-related categories (Audio & Videos) in place of the existing Media category as per #47847 (comment)

Why?

Allows for better organisation of curated patterns.

How?

  • Deregisters Media block pattern category Media category remains due to BC concerns.
  • Registers Audio, Images, and Videos categories

Note: There didn't appear to be any curated patterns for the Media category currently in the directory. I'm not 100% certain on the backwards compatibility of removing the media category. Should themes be categorizing patterns under this they could register their own media category or assign patterns to the new categories. See: #47847 (comment)

Testing Instructions

  1. Activate TT3
  2. In the post editor, navigate to the inserter and Patterns tab
  3. Confirm the images category is present and contains patterns from the directory Images category should not display
  4. Note the Audio and Video categories will not display as there currently aren't any core/theme/directory patterns assigned to them
  5. Open the site editor's patterns page (Appearance > Editor > Patterns)
  6. Neither of the new categories should show in the sidebar yet
  7. Select the option in the sidebar to create a new pattern
  8. Confirm the category selector in the create pattern modal suggests both Audio and Videos
  9. Try adding patterns to each of the new categories and confirm they display in both the site and post editors

Screenshots or screencast

Screen.Recording.2023-10-11.at.11.43.20.am.mp4

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Oct 11, 2023
@github-actions
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/compat/wordpress-6.5/block-patterns.php
❔ lib/load.php

@github-actions
Copy link

github-actions bot commented Oct 11, 2023

Flaky tests detected in f0cfaad.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6504855860
📝 Reported issues:

Copy link
Member

@kevin940726 kevin940726 left a comment

Choose a reason for hiding this comment

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

Works well for me! 👍

@aaronrobertshaw aaronrobertshaw merged commit 343b903 into trunk Oct 17, 2023
49 checks passed
@aaronrobertshaw aaronrobertshaw deleted the update/media-related-pattern-categories branch October 17, 2023 02:11
@github-actions github-actions bot added this to the Gutenberg 16.9 milestone Oct 17, 2023
@aaronrobertshaw
Copy link
Contributor Author

Backport PR available in: WordPress/wordpress-develop#5943

@youknowriad youknowriad added the Backported to WP Core Pull request that has been successfully merged into WP Core label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants