Conversation
|
will this mean that I get to see the Friends page in my blog's theme? If so, when is this coming... #askingForAFriend |
0ed1072 to
c384a15
Compare
Owner
Author
|
Yes! I can't give a date yet, sorry. Welcoming contributions :) |
98f54b6 to
ad4f706
Compare
ad4f706 to
631f0c3
Compare
Merged
11d2998 to
9894a39
Compare
d00b3be to
3548729
Compare
Contributor
Test this PR in WordPress PlaygroundYou can test this pull request directly in WordPress Playground: This will install and activate the plugin with the changes from this PR. |
|
Even just providing the core components of the Friends page in block format could resolve the major need here |
- Don't dequeue global-styles or friends theme styles in dequeue_scripts - Fix extra } in post-title block attribute in index.html - Add pagination inside query block in index.html - Replace placeholder text in footer.html with a valid block - Remove site-specific widget instance hashes from sidebar.html - Fix composer.json dependency conflict (phpcompatibility version)
- Add friends/subscriptions-query block: iterates subscriptions passing each as block context, mirroring the wp:query + wp:post-template pattern - Add friends/subscription block: renders a subscription card from context, works for both WP users and virtual subscriptions (taxonomy terms) - Add friends/followers block: server-side rendered ActivityPub followers list - Add friends-followers.html and friends-subscriptions.html block templates - Route subpage requests to block templates via $_wp_current_template_content when a block theme is active, falling back to PHP templates otherwise
- Register 'block' as a selectable Friends frontend theme via friends_load_themes, rather than always overriding the stylesheet - Move stylesheet filter into block_theme() so it only activates when the block theme is chosen - Add single-friend_post_cache.html block template for single post view
Only use block theme template paths when the Friends block theme is explicitly selected, not just because the site's WP theme is a block theme. Also restore global-styles dequeue for the default theme and fix get_user_option call that passed 'expanded' as user ID.
- Only use block theme code paths when explicitly selected - Restore global-styles dequeue for default theme - Fix get_user_option call using wrong parameter - Register friends theme directory for site editor discovery - Add pre_get_block_file_template filter for friends// templates - Replace legacy widgets with proper blocks (stats, refresh, post-formats, add-subscription) with editor support - Enqueue site theme stylesheet alongside friends block theme
- Use wp-block-heading class on starred friends heading for consistent styling with template headings - Check database for user-customized template parts before falling back to plugin files, so site editor changes are respected
Use core blocks (post-author-name, post-title, post-content) in the query loop so the site editor can render previews. Only the permalink section (time ago, domain, reading time) remains a custom block.
Friend posts contain raw HTML from feeds, not WordPress blocks. The core post-content block runs it through the block parser which wraps it in freeform blocks and iframes. This custom block renders the content directly with wp_kses_post and wpautop.
Tests cover: - Block registration for all custom blocks - Template and template part files exist on disk - Template content mapping (get_block_template_content_for) - Render output of each block (search, feed-header, stats, refresh, post-formats, add-subscription, post-permalink, post-content, author-header, starred-friends-list) - Placeholder rendering when no post/author context - Template structure (correct blocks referenced, no footer) - calculate_read_time accessibility and correctness
The reflection in the test was triggering a doctrine/instantiator autoload conflict in CI. Make the method public for testability and restore the starred friends list test.
…conflict" This reverts commit 80da70f.
The test assumed no starred subscriptions exist but the test environment may return results. Check the actual query result and assert the correct output structure for either case. This also fixes the PHP 8.2 CI crash where the assertion failure triggered doctrine/instantiator autoload via PHPUnit error output.
- friends/feed-header → friends/feed-title (h2 heading) + friends/feed-chips (post counts, hidden items, reactions) - friends/author-name now renders as h2 with id="page-title" - friends/author-description shows placeholder in site editor - Both feed-chips and author-chips use identical chip markup (<a class="chip">) so one CSS rule styles all chips consistently - Header and author-header template parts compose the individual blocks so each is selectable and styleable in the site editor
All sidebar widgets, chip blocks, heading blocks, and permalink block now have WordPress block supports (color, typography, spacing). The site editor shows sidebar controls to change background, text color, link color, font size, line height, padding and margin — no custom CSS needed. Each render callback uses get_block_wrapper_attributes() to apply the user's style choices to the wrapper element.
Remove the "Friends Visibility" editor panel, block-visibility JS, and related dead code since the friendship feature was removed. Keep a simplified render_block filter that hides content marked with the "only-friends" CSS class to prevent accidental exposure of previously hidden content. Content marked "not-friends" is shown to everyone.
- Add "starred" as a user_types option to friends/friends-list - Remove separate friends/starred-friends-list block - Add block supports (color, typography, spacing) to block.json - Update editor JS with current options (subscriptions, starred) - Rebuild with latest @wordpress/scripts - Use get_block_wrapper_attributes() for styling support - Update sidebar template to use friends-list with user_types attr
New friends/post-footer block renders the interaction buttons for each post in the block theme query loop: - Reblog button with status indicator - Boost button (when ActivityPub is active) with status indicator - Emoji reaction buttons with counts and reaction picker - Comments button with AJAX loading and mention indicator - Comments content container for AJAX-loaded comments The existing JS in friends.js handles all interactions via event delegation on CSS class selectors, so no JS changes needed.
Split friends/post-footer into four individual blocks: - friends/post-reblog, friends/post-boost, friends/post-reactions, friends/post-comments Wrapped in a flex group so they appear on one horizontal line. Users can add/remove individual blocks in the site editor.
- Use href="#" instead of get_comments_link() to prevent navigation - Wrap comments link and content container in a single div so JS can find .comments-content relative to the clicked link - Update JS loadComments to find .comments-content in block theme context (closest .wp-block-friends-post-comments or li) - Add block theme selector to comments click handler - Fix JS error when .card ancestor not found in block theme
- Default $attributes parameter to empty array so tests can call render methods without arguments - Add get_wrapper_attributes() helper that safely falls back when not in a block rendering context (avoids null access crash in WP_Block_Supports when called from unit tests)
Owner
Author
|
Ok! I think this is good enough for shipping it in 4.0! |
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.
Styles are still rough but it shows that it works. The idea is to provide a block theme when the user has a block theme installed so that they can edit their friends page in the same way they can edit their WordPress site.This now adds a block theme to the theme selector. If selected, we load a

friends//indextemplate on the/friends/page so that you can select "Edit Site" while on the Friends page and you can edit it:Instead of swapping to a separate theme, block template content is injected via
$_wp_current_template_content, so the site'stheme.json, global styles, and stylesheets apply naturally. Templates are registered as plugin templates viaWP_Block_Templates_Registry. Template parts are resolved via apre_render_blockfilter, and user customizations via the Site Editor are respected.To achieve this, I added a number of blocks. All are server-side rendered and individually selectable/styleable in the Site Editor (color, typography, spacing via block
supports):Sidebar blocks:
friends/stats— follower/subscription countsfriends/refresh— refresh linkfriends/post-formats— post format filter linksfriends/friends-list— subscription list withuser_typesattribute (subscriptions,starred,folders)friends/add-subscription— link to add subscriptionFeed header blocks:
friends/feed-title— "Main Feed" / "Status Feed" etc. as<h2>friends/feed-chips— post count chips, hidden items, reaction chipsfriends/search— search form with autocompleteAuthor header blocks (granular for individual styling):
friends/author-star— star/unstar togglefriends/author-avatar— profile imagefriends/author-name— display name as<h2>friends/author-description— bio textfriends/author-chips— role, since date, URL, post counts, reactions, feeds, edit/refreshPost entry blocks (inside query loop, uses core blocks where possible):
core/post-author-name— with Friends-specific override for feed authorscore/post-title— linked to external URLcore/post-content— standard WordPress blockfriends/post-permalink— "3 days ago on domain.com · 2 min read"friends/post-reblog— reblog button with status indicatorfriends/post-boost— boost button (auto-hides if no ActivityPub)friends/post-reactions— emoji reactions with inline pickerfriends/post-comments— AJAX-loaded comments with reply supportOther changes:
only-friendscontentTest plan
/friends/— feed header with post count chips (AJAX-loaded), search top-right, expanded posts with permalink, reblog/boost/reactions/comments/friends/{username}/— author header with star, avatar, chips/friends/{username}/{post_id}/— minimal header, single post view/friends/subscriptions/and/friends/followers/— render correctly