RS Post Settings: Fetch site post formats from themes API#22710
Draft
RS Post Settings: Fetch site post formats from themes API#22710
Conversation
Fetch the active theme's supported post formats via the wordpress-rs themes API instead of hardcoding all 10 formats. Falls back to the full default list on failure or when the theme doesn't declare support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant outer try/catch (caller already handles exceptions) and replace mutable list + none/add pattern with distinct() for prepending Standard format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defer the themes API call until the user actually opens the format picker, avoiding an unnecessary network request on every screen load. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
|
Contributor
|
|
Contributor
|
|
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Description
The RS post settings
FormatDialogpreviously hardcoded all 10 standard post formats. This PR fetches the formats actually supported by the site's active theme using the wordpress-rs themes API (themes().listWithViewContext()), falling back to the full default list if the API call fails.Testing instructions
Theme with limited format support:
Fallback on failure: