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

Use slug instead of id for Font Collection #57735

Merged
merged 6 commits into from
Jan 11, 2024

Conversation

pbking
Copy link
Contributor

@pbking pbking commented Jan 10, 2024

What?

This removes the id property from the Font Collection object and uses slug instead.

Why?

The value is treated like a slug, but with the wrong name. This just changes what we call it.
Fixes: (?)

How?

By changing the Font Collection class, the rest controller, the default collection and all related unit tests.

Testing Instructions

The unit tests should all pass.
The "default" (Google Fonts) collection should still be available to the user.

NOTE: These changes are dependent on #57734 being merged first; those changes are already incorporated into these.

@pbking pbking added [Feature] Typography Font and typography-related issues and PRs [Type] Experimental Experimental feature or API. labels Jan 10, 2024
Copy link

github-actions bot commented Jan 10, 2024

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/experimental/fonts/font-library/class-wp-font-collection.php
❔ lib/experimental/fonts/font-library/class-wp-font-library.php
❔ lib/experimental/fonts/font-library/class-wp-rest-font-collections-controller.php
❔ lib/experimental/fonts/font-library/font-library.php
❔ phpunit/tests/fonts/font-library/wpFontCollection/__construct.php
❔ phpunit/tests/fonts/font-library/wpFontCollection/getConfig.php
❔ phpunit/tests/fonts/font-library/wpFontCollection/getConfigAndData.php
❔ phpunit/tests/fonts/font-library/wpFontLibrary/getFontCollection.php
❔ phpunit/tests/fonts/font-library/wpFontLibrary/getFontCollections.php
❔ phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php
❔ phpunit/tests/fonts/font-library/wpFontLibrary/unregisterFontCollection.php
❔ phpunit/tests/fonts/font-library/wpRestFontCollectionsController/getFontCollection.php
❔ phpunit/tests/fonts/font-library/wpRestFontCollectionsController/getFontCollections.php
❔ phpunit/tests/fonts/font-library/wpRestFontCollectionsController/registerRoutes.php

Copy link
Contributor

@matiasbenedetto matiasbenedetto left a comment

Choose a reason for hiding this comment

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

I think there was a mistake while committing to this branch because the changes don't match the PR title and description.

@pbking pbking force-pushed the try/use-slug-instead-of-id-for-font-collection branch from d4c6df4 to 0094034 Compare January 10, 2024 21:30
@pbking
Copy link
Contributor Author

pbking commented Jan 10, 2024

Sorry @matiasbenedetto I'm not sure what happend with the work. I force-pushed and the changes are here now.

Copy link
Contributor

@matiasbenedetto matiasbenedetto left a comment

Choose a reason for hiding this comment

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

The changes are looking and testing good.
Let's ship them after the CI pass.

@matiasbenedetto matiasbenedetto merged commit 8599e15 into trunk Jan 11, 2024
55 checks passed
@matiasbenedetto matiasbenedetto deleted the try/use-slug-instead-of-id-for-font-collection branch January 11, 2024 13:04
@github-actions github-actions bot added this to the Gutenberg 17.6 milestone Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Typography Font and typography-related issues and PRs [Type] Experimental Experimental feature or API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants