Make WordPress Core

Opened 15 years ago

Last modified 5 years ago

#10275 reopened defect (bug)

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

Reported by: hakre's profile hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Themes Keywords: dev-feedback
Focuses: template Cc:


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 (8)

#1 @Denis-de-Bernardy
15 years ago

  • Milestone changed from Unassigned to 2.9

#2 @hakre
14 years ago

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

#3 @ryan
14 years ago

  • Milestone changed from 2.9 to Future Release

#4 @hakre
12 years ago

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

#5 @ocean90
12 years ago

  • Milestone Future Release deleted

#6 @Ninos Ego
9 years 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...

#7 @SergeyBiryukov
9 years ago

  • Component changed from General to Themes
  • Milestone set to Awaiting Review

#8 @chriscct7
8 years ago

  • Keywords dev-feedback added
Note: See TracTickets for help on using tickets.