-
Notifications
You must be signed in to change notification settings - Fork 81
Blocks: Cleanup after Interactivity moves #1750
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
Merged
Merged
Conversation
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
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
Refactors block initialization after migrating to the Interactivity API, centralizing option handling and cleaning up legacy script injection.
- Move
_activityPubOptions
enqueuing into the block editor and remove standalone injection. - Refactor the editor plugin to use a shared
useOptions()
hook and early-return forwp_block
. - Reorder
register_block_type_from_metadata()
calls to match directory structure.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/editor-plugin/plugin.js | Swapped hook order, added useOptions() , and moved the wp_block check above hooks. |
includes/class-blocks.php | Removed legacy injections, added wp_localize_script() for editor assets, and reordered block registrations. |
build/editor-plugin/plugin.js | Rebuilt minified editor plugin bundle. |
build/editor-plugin/plugin.asset.php | Updated asset version hash. |
Co-authored-by: Copilot <[email protected]>
@obenland there are some conflicts! |
pfefferle
approved these changes
Jun 4, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Post settings
[Focus] Editor
Changes to the ActivityPub experience in the block editor
Skip Changelog
Disables the "Changelog Updated" action for PRs where changelog entries are not necessary.
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.
With the move to the Interactivity API, there's a bit more cleanup we can do, once #1747 is merged:
Proposed changes:
_activityPubOptions
to being enqueued in the Editor only.register_block_type_from_metadata()
calls to be in order of folder definition.useOptions()
in editor-plugin instead of accessing_activityPubOptions
directly.wp_block
post type check in editor-plugin to the top of the function.Testing instructions: