-
Notifications
You must be signed in to change notification settings - Fork 82
Follow Me: Improve MU compatibility #1777
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
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Improves the Follow Me block’s behavior for users without the unfiltered_html
capability, correctly migrates broken button inner blocks, and ensures accurate post/follower counts.
- Adds a deprecation handler to migrate button-only blocks when HTML is stripped
- Renames stats properties to
postsCount
/followersCount
, removes customtagName
, and fetches site-wide post counts via the NodeInfo endpoint - Refactors InspectorControls to hide the panel when only one user is available and bumps block version
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/follow-me/render.php | Use site-wide post count when userId is zero |
src/follow-me/edit.js | Rename stats keys, remove tagName , add NodeInfo fetch, update controls |
src/follow-me/deprecation.js | Add v3 migration for stripped button HTML |
src/follow-me/block.json | Bump version from 2.1.0 to 2.2.0 |
This is still not working quite right |
Back in business! The deprecation now converts all buttons to anchors, even if they don't error, and they behave more like buttons in the front-end, including keyboard navigation |
Is this the way to go in terms of accessibility? Do we have to at least add |
I did add it here. And no, it is not. But it's either turning the button into an anchor, or the block breaking for everyone who doesn't have the |
We could also save it as an anchor, then render it as a button in the front-end. |
Proposed changes:
unfiltered_html
capability.tagName
attribute in favor of the default anchor to account for users that don't have theunfiltered_html
capability.userOptions
check to avoid showing an empty options panel when there is only one user.Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Avoids the button block breaking for users that don't have the
unfiltered_html
capability.Blog users now get their correct post count displayed in the Editor and the front-end.