Skip to content

Add notice to switch from legacy template mode to automatic mode#2985

Merged
pfefferle merged 12 commits intotrunkfrom
fix/legacy-template-mode-notice
Mar 1, 2026
Merged

Add notice to switch from legacy template mode to automatic mode#2985
pfefferle merged 12 commits intotrunkfrom
fix/legacy-template-mode-notice

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Feb 28, 2026

Fixes #2984

Proposed changes:

  • When users have the legacy template mode (note) active, a notice is now shown directly in the "Post content" settings field with a button to switch to automatic mode.
  • Previously, users had to enable the Advanced Settings tab and manually uncheck the "Use Template Tags" option — which was not discoverable.

Screenshot

Legacy template mode notice

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Set the activitypub_object_type option to note (either via WP-CLI: wp option update activitypub_object_type note, or via the Advanced Settings tab).
  • Go to Settings → ActivityPub → Settings tab.
  • Verify a notice appears in the "Post content" field explaining the legacy template mode, with a "Switch to Automatic Mode" button.
  • Click the button.
  • Verify the page reloads, the notice and template textarea are gone, and the option is set back to wordpress-post-format.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Added - for new features

Message

Add a notice on the Settings page to easily switch from legacy template mode to automatic mode.

Copilot AI review requested due to automatic review settings February 28, 2026 14:01
@pfefferle pfefferle self-assigned this Feb 28, 2026
@pfefferle pfefferle requested a review from a team February 28, 2026 14:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_type back 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' ); ?>

@pfefferle pfefferle merged commit 9867459 into trunk Mar 1, 2026
12 checks passed
@pfefferle pfefferle deleted the fix/legacy-template-mode-notice branch March 1, 2026 10:51
@pfefferle pfefferle restored the fix/legacy-template-mode-notice branch March 1, 2026 22:52
@pfefferle pfefferle deleted the fix/legacy-template-mode-notice branch March 1, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to switch from legacy template mode without enabling advanced settings

3 participants