[wp-trac] Re: [WordPress Trac] #5662: Class Ancestor Pages

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 15 19:41:52 GMT 2008


#5662: Class Ancestor Pages
-------------------------------------+--------------------------------------
 Reporter:  AaronCampbell            |        Owner:  anonymous
     Type:  enhancement              |       Status:  new      
 Priority:  normal                   |    Milestone:  2.5      
Component:  General                  |      Version:           
 Severity:  normal                   |   Resolution:           
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by AaronCampbell):

 The patch is imperfect.  It doesn't work if you are on the main page (ID
 == 0).  There are two ways to fix this.  First, inside `get_page` you can
 replace `if ( empty($page) ) {` with `if ( empty($page) && $page !== 0 )
 {`  Alternatively, we could simply use get_post rather than get_page.  I
 guess if we plan on phasing out get_page, then we should use get_post.  If
 get_page is supposed to stay, you could use the other fix.  I suppose we
 could also check for null being returned from get_page.

 Someone want to weigh in?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5662#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list