[wp-trac] [WordPress Trac] #14309: twentyten_header_image_height hook called before query

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 14 22:03:17 UTC 2010


#14309: twentyten_header_image_height hook called before query
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |       Owner:                 
     Type:  enhancement   |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.0            
 Severity:  normal        |    Keywords:                 
--------------------------+-------------------------------------------------
 I don't know if this is anything we can address but the
 twentyten_header_image_height hook is called within the after_setup_theme
 hook which is well before wp_query has been set up by $wp->query() and
 hence functions like is_front_page() are as-of-yet undefined.

 Of course the header image height is something that would most likely
 changed based on whether it's front page or not so I thought I'd bring up
 this issue (in my current project there is a header only on the front
 page, no where else.)

 Not sure what to suggest about this. Ultimately is_page() returns false
 even though it is a page and thus is_front_page() returns false. Maybe
 is_front_page() could test if $wp->query() has been run yet and if not do
 something different?

 Or maybe simply throw an error saying is_front_page() not defined yet.
 That would be better than others repeating my wasted hour trying to figure
 out why "obviously correct" logic isn't working.  :)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14309>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list