Add notice to switch from legacy template mode to automatic mode#2985
Merged
Add notice to switch from legacy template mode to automatic mode#2985
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an in-context notice on the ActivityPub Settings screen to help users switch from legacy template mode to automatic mode.
Changes:
- Add a new settings-page load handler that switches
activitypub_object_typeback to the default when a nonce-protected query arg is present. - Render a notice + “Switch to Automatic Mode” action within the “Post content” settings field.
- Add a changelog entry describing the new settings UX.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| includes/wp-admin/class-settings.php | Adds a load hook handler to process the “switch to automatic mode” action and redirect back to settings. |
| includes/wp-admin/class-settings-fields.php | Renders a warning + action link in the post content setting UI. |
| .github/changelog/2985-from-description | Documents the patch-level addition in the changelog. |
Comments suppressed due to low confidence (1)
includes/wp-admin/class-settings-fields.php:267
- The “⚠” symbol is embedded in the translatable string and may be announced verbosely by screen readers, and it can be awkward for translators. Prefer using semantic markup (e.g., a styled notice container, or an icon element with
aria-hidden="true"plus separate screen-reader text) instead of including the symbol directly in the localized message.
<?php \esc_html_e( '⚠ You are using the legacy template system to format your posts for the fediverse. We recommend switching to automatic mode, which intelligently chooses the best format for each post.', 'activitypub' ); ?>
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.
Fixes #2984
Proposed changes:
note) active, a notice is now shown directly in the "Post content" settings field with a button to switch to automatic mode.Screenshot
Other information:
Testing instructions:
activitypub_object_typeoption tonote(either via WP-CLI:wp option update activitypub_object_type note, or via the Advanced Settings tab).wordpress-post-format.Changelog entry
Changelog Entry Details
Significance
Type
Message
Add a notice on the Settings page to easily switch from legacy template mode to automatic mode.