Skip to content

Remove the apply_filters attribute of [ap_content] - #3880

Merged
pfefferle merged 5 commits into
trunkfrom
update/deprecate-content-apply-filters
Oct 15, 2026
Merged

pfefferle merged 5 commits into
trunkfrom
update/deprecate-content-apply-filters

Conversation

@pfefferle

@pfefferle pfefferle commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Proposed changes:

  • [ap_content] always runs the_content now. The apply_filters attribute is removed.
  • A template that still uses apply_filters="no" gets the filtered content and a _doing_it_wrong() notice. apply_filters="yes" was the default and stays quiet.
  • The help tab only lists [ap_content].

Other information:

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

apply_filters="no" skipped all the_content filters, also the ones a post needs to render correctly, e.g. plugins that hide parts of a post. With #3877 the summary also runs through the_content, so content and summary should work the same way.

Sites with apply_filters="no" in their legacy template will now get the output of all content filters, like share buttons. To keep a single filter out of federated content, remove it in activitypub_before_get_content:

add_action( 'activitypub_before_get_content', function () {
    remove_filter( 'the_content', 'sharing_display', 19 );
} );

Testing instructions:

  • Switch to the legacy template mode and use [ap_content apply_filters="no"] in the template.
  • Publish a post with WP_DEBUG on: the content runs through all content filters, and a notice is logged.
  • Use [ap_content] or [ap_content apply_filters="yes"]: no notice.

Changelog entry

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

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

The option to turn off content filters in the post template was removed. Federated posts now always use the regular content filters.

@pfefferle pfefferle self-assigned this Oct 12, 2026
@pfefferle
pfefferle requested a review from a team October 12, 2026 07:30
@pfefferle pfefferle changed the title Deprecate the apply_filters attribute of [ap_content] Remove the apply_filters attribute of [ap_content] Oct 12, 2026
@pfefferle pfefferle added the Enhancement New feature or request label Oct 12, 2026
@pfefferle
pfefferle merged commit 0b90c5a into trunk Oct 15, 2026
11 checks passed
@pfefferle
pfefferle deleted the update/deprecate-content-apply-filters branch October 15, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant