WordPress.org

Ready to get started?Download WordPress

Forums

*_template filters run twice (1 post)

  1. wundbread
    Member
    Posted 8 years ago #

    In wordpress 2.0 I noticed that all the template filters ('single_template','achive_template', etc) get run twice. I still can't login to trac to post a bug, so I'm posting here. I currently do not understand why this is occuring or how to fix it.

    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 "{$call['file']} ({$call['line']}) in {$call['function']}()<br/>";
    return $template;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags