WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 5 months ago

#10275 reopened defect (bug)

Filter logic has been put into the template loader while it not belongs there.

Reported by: hakre Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.8
Component: Themes Keywords:
Focuses: template Cc:

Description

Some time ago, filter logic has been introduced in the template-loader. Looks like a fix for the inability to handle attachments propperly (WP misses more and more a strict request parsing so that newer features tend to introduce more and more bugs).

The code has not been removed yet. It should be removed there or put into a more appropriate location.

The code in question is:

remove_filter('the_content', 'prepend_attachment');

in /wp-inclueds/template-loader.php around line 30.

Change History (7)

comment:1 @Denis-de-Bernardy6 years ago

  • Milestone changed from Unassigned to 2.9

comment:2 @hakre6 years ago

related: #6357 , code in question was introduced by ryan

comment:3 @ryan5 years ago

  • Milestone changed from 2.9 to Future Release

comment:4 @hakre3 years ago

  • Keywords needs-patch removed
  • Resolution set to maybelater
  • Status changed from new to closed

comment:5 @ocean903 years ago

  • Milestone Future Release deleted

comment:6 @Ninos Ego6 months ago

  • Focuses template added
  • Resolution maybelater deleted
  • Status changed from closed to reopened

Is it planned to remove this filter in one of the next releases? I think this hack should be removed from code, otherwise you'll see the attachments image on the attachment page if you're using the the_content filter for compiling shortcodes in widgets or somewhere else.
For theme developers it should be very easy to add a new line of code to their single-attachment.php (or use map the attachment image to the post_thumbnail function). If you want I can publish a patch...

comment:7 @SergeyBiryukov5 months ago

  • Component changed from General to Themes
  • Milestone set to Awaiting Review
Note: See TracTickets for help on using tickets.