Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#24154 closed enhancement (duplicate)

Use separate filter hooks for formatting and displaying content

Reported by: bungeshea Owned by:
Priority: normal Milestone:
Component: Template Version:
Severity: normal Keywords:
Cc: Focuses:

Description

The functions that format the post content are hooked to the_content filter. So if I wanted to format some text in the same way the post content is formatted, I'd use apply_filters( 'the_content', $text_to_format );

However, some plugins (especially social sharing buttons, Jetpack is an offender) hook to the_content to add additional output to the end of the post content. This really messes up when formatting text using the_content filter, as you get all of these social sharing buttons and related posts tacked onto the end of it. Currently the only way to safely format custom text is to apply the functions manually.

Instead, let's hook those formatting functions to a separate hook (eg: format_content), which is then applied to the post content along with the_content. New plugins can use the format_content hook to format their custom text, existing plugins don't break and everyone is happy.

Change History (1)

#1 @SergeyBiryukov
13 years ago

  • Component FormattingTemplate
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Severity trivialnormal
  • Status newclosed
  • Summary Use seperate filter hooks for formatting and displaying contentUse separate filter hooks for formatting and displaying content

Duplicate of #18561.

Note: See TracTickets for help on using tickets.