Include custom post type archives in static exports - #12
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe plugin now adds eligible public custom post-type archive URLs to Simply Static exports. It excludes attachments, unavailable archives, and unselected post types. The release version is updated to 0.5.7 with matching tests and changelog entries. ChangesStatic archive export
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SimplyStatic
participant SpacefastPlugin
participant WordPressPostTypes
SimplyStatic->>SpacefastPlugin: apply ss_additional_urls
SpacefastPlugin->>WordPressPostTypes: get public post types
WordPressPostTypes-->>SpacefastPlugin: post-type objects and names
SpacefastPlugin->>WordPressPostTypes: get archive links
WordPressPostTypes-->>SpacefastPlugin: archive URLs or false
SpacefastPlugin-->>SimplyStatic: original and deduplicated archive URLs
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3642af9468
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ? $options['post_types'] | ||
| : array(); | ||
| $configured = ! empty( $options['post_types_configured'] ) || array() !== $selected; | ||
| $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
There was a problem hiding this comment.
Filter archives by front-end viewability
When a post type is registered with public => false, publicly_queryable => true, and has_archive => true, WordPress can expose a working front-end archive, but this query omits it because it checks only public. Conversely, a type can be public while explicitly not publicly queryable and will be added even though its archive route is not viewable. Determine eligibility using the post type's front-end viewability so valid archive links are exported without queueing inaccessible routes.
Useful? React with 👍 / 👎.
Summary
Verification
./bin/test.sh./bin/test-wordpress.shNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores