feat: brand account feed shortcode + block (closes #10)#40
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds support for a site-wide “brand account” feed by fetching posts from a configured Mastodon account and exposing that feed via a new shortcode and a server-rendered Gutenberg block.
Changes:
- Implement
OUTPOST_Feed_Fetcher::get_account_posts()with account-id lookup, caching, and reply/boost exclusion. - Add
[outpost_account_feed]shortcode plusoutpost/account-feedblock that renders via the shortcode. - Extract shared feed markup into
render_posts_list()and document the new feature in the README.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| includes/class-outpost-feed-fetcher.php | Adds brand-account fetching, caching, and cron warm-up. |
| includes/class-outpost-shortcodes.php | Registers the new shortcode and shares post-list rendering markup. |
| includes/class-outpost-blocks.php | Registers the new account-feed block and render callback. |
| blocks/account-feed/editor.js | Adds editor UI for the account-feed block (SSR preview + limit control). |
| blocks/account-feed/editor.asset.php | Declares editor script dependencies/version (no build step). |
| blocks/account-feed/block.json | Declares block metadata and the limit attribute. |
| tests/Unit/AccountPostsTest.php | Adds unit tests for get_account_posts() early-return cases. |
| tests/Unit/AccountFeedBlockTest.php | Adds unit tests for the account-feed block render callback. |
| README.md | Documents configuring and displaying the account feed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return []; | ||
| } | ||
|
|
||
| $cache_key = 'outpost_account_feed'; |
Comment on lines
+96
to
+99
| list( $username, $host ) = explode( '@', $handle, 2 ); | ||
| if ( '' === $username || '' === $host ) { | ||
| return []; | ||
| } |
Comment on lines
+31
to
+33
| min: 1, | ||
| max: 50, | ||
| } ) |
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.
Phase 3, Part 2 of the source-account feature (#10). Rebased onto
mainafter #9 (#38) merged; replaces auto-closed #39.What
OUTPOST_Feed_Fetcher::get_account_posts()— resolves the brand account id and fetches original posts only (exclude_replies/exclude_reblogs), cached with stale-fallback; account id cached for a day.render_posts_list()helper (no change to the hashtag feed output).[outpost_account_feed limit="20"]shortcode andoutpost/account-feedblock (server-rendered via the shortcode).Accessibility
accessibility-leadreviewed the new feed (section/heading wiring + reused markup pass). Its one "critical" on theesc_html→wpautop→wp_kses_postchain was verified as a false positive (plain-text input renders correctly; removing esc_html would strip<word>content) and is pre-existing code moved verbatim — out of scope here.Tests
22/22 unit tests pass.
Manual verification
[outpost_account_feed]and the Mastodon Account Feed block show that account's original posts (no replies/boosts).Closes #10
🤖 Generated with Claude Code