#9760 closed defect (bug) (invalid)
global $post->ID id of first search result in searches
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.7.1 |
| Component: | Plugins | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
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($_GETs?))
Surely this is a bug?
Shouldn't in the case of searches the $post object return 0?
Change History (3)
Note: See
TracTickets for help on using
tickets.
the $post variable is populated on multiple points with different values. there is no strict rule at which point that variable must or must not have a certain value as you are trying to do for the search.
it might help you to checkout Conditional Tags documentation in codex to find some code that is checking for various requests (or queries) in wordpress.
i must say that is not a bug. please consider codex or the forums to get help with plugin evelopment.