Thanks for the response Michael.
I think this is related to the invocation process of the theme_header(..) and the filter_theme_call_header(..) function. see "How to Reorder Theme Function Results" section in
http://wiki.habariproject.org/en/Theme_FunctionsI found out that you would need at least a definition for the filter_theme_call_header(..) function down in the process if any theme_header(..) definition occur _with_ or _before_ it within the process. Considering that theme methods are invoked after those in plugins, I am using the K2 system theme and a plugin (preferable that does not contain a definition to any of those 2 functions) to duplicate the issue in a couple of cases below
Case1: No calls to the filter_theme_call_header() method in the whole process.
1) Deactivate all the plugins.
2) Assume that we don't need to include the jquery in K2's theme.php so we completely delete the definition for filter_theme_call_header
3) At this point, no definition to any of those 2 function occur in the process, so the home page displays fine.
4) Activate your plugin of choice and add a definition of theme_header() and make sure that it has no filter_theme_call_header() defined, like so:
public function theme_header($theme){
echo "Hello from the plugin";
}
5) You now see a white page with only the Hello message printed at the top when accessing the home page
Case2: Calls in the "wrong" order.
1) Repeat step1 and step2 in Case1 above
2) Add a definition to theme_header() within K2's theme.php, something like so:
public function theme_header($theme){
echo "Hello from the K2's theme.php";
}
3) You would also see a white page with only the Hello message printed at the top when accessing the home page.
4) Now define filter_theme_call_header within the plugin used in testing and activate it. we can use a simple definition like so:
public function filter_call_theme_header($return, $theme){
echo "Hello from filter_call_theme_header in the plugin";
return $return;
}
5) Same issue and strangely enough, it would not display the second echo text, rather it echos the one in step 2 above.
This makes me think that first all theme_header() methods are invoked, and then it searches for the filter_theme_call_header() methods down the ladder only, and when it can't find it, it crashes.
What concerns me that if a custom theme is used, one that does not redefine filter_theme_call_header() method. And you use a plugin that uses theme_header to insert some code into your header. You would end up with a blank page. Which is one of the many scenarios that may be encountered
Cheers,
Ali