Ticket #2225 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

*_template filters execute twice

Reported by: wundbread Assigned to: anonymous
Priority: normal Milestone:
Component: General Version: 2.0
Severity: normal Keywords: template filters bg|has-patch
Cc:

Description

In wordpress 2.0 I noticed that all the template filters ('single_template','achive_template', etc) get run twice. I currently do not understand why this is occuring or how to fix it. I don't believe this happened in 1.52.

Here is a simple plugin to show this.

/*

Plugin Name: Template Filters Execute Twice

Description: Demonstates that *_template filters are currently executing twice.

Author: Michael O'Connell

Version: 1.0

*/ add_filter('archive_template', 'print_trace');

function print_trace($template) { foreach(debug_backtrace() as $call) echo "{$callfile?} ({$callline?}) in {$callfunction?}()<br/>"; return $template; }

Attachments

2225.diff (2.8 kB) - added by davidhouse on 01/05/06 18:10:24.

Change History

01/05/06 18:10:24 changed by davidhouse

  • attachment 2225.diff added.

01/05/06 19:57:54 changed by davidhouse

  • keywords changed from template filters to template filters bg|has-patch.

01/06/06 01:09:17 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [3409]) Avoid invoking template filters twice. Props David House. fixes #2225

01/06/06 01:17:30 changed by ryan

  • milestone changed from 2.1 to 2.0.1.

11/30/06 19:41:49 changed by

  • milestone deleted.

Milestone 2.0.1 deleted