[wp-hackers] Getting the Post ID for a single page request

Randy Peterman randy at randypeterman.com
Wed Sep 29 14:19:58 UTC 2004


OK, so I've written StatTraq, which does some statistical reporting for 
WordPress and I have one person who's got a unique installation that 
won't return the post ID.  In his installations he's using the 
mod_rewrite rules so that the post ID is not passed in the URL. 
However, another StatTraq user wrote the following change for my code 
that works for him:

if ($single) {
  $p = intval($post->ID);
  $article_id = $p;
}

So, the question I have is if someone was using varying versions of 
WordPress would the '$single' variable not be set?

Regards,

-- 
Randy Peterman
Digital Research & Development
www.randypeterman.com
randy at randypeterman.com





More information about the hackers mailing list