[wp-trac] [WordPress Trac] #9760: global $post->ID id of first search result in searches

WordPress Trac wp-trac at lists.automattic.com
Fri May 8 09:35:34 GMT 2009


#9760: global $post->ID id of first search result in searches
--------------------------+-------------------------------------------------
 Reporter:  d.busby       |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  normal        |   Milestone:  Unassigned             
Component:  Plugins       |     Version:  2.7.1                  
 Severity:  normal        |    Keywords:  $post, post, id, search
--------------------------+-------------------------------------------------
 I have written a plugin "aptus" soon to be released to the community, one
 of it's functions is a breadcrumb navigation generator.

 Currently whenever a search is made, upon hitting the search results page
 the global $post->ID is populated with the ID of the first search result,
 this in turn goes on to populate the breadcrumb with content as if the
 user was currently on the first result page.

 Currently I am using a work around.

 if(empty($_GET['s']))

 Surely this is a bug?

 Shouldn't in the case of searches the $post object return 0?

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


More information about the wp-trac mailing list