Use is_singular in url_to_postid(). See #15771

git-svn-id: https://develop.svn.wordpress.org/trunk@16877 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu 2010-12-11 09:25:02 +00:00
parent dfb1f77e3b
commit 9c1dd77de9
1 changed files with 1 additions and 1 deletions

View File

@ -337,7 +337,7 @@ function url_to_postid($url) {
// Do the query
$query = new WP_Query($query);
if ( !empty($query->posts) && ($query->is_single || $query->is_page) )
if ( !empty($query->posts) && $query->is_singular )
return $query->post->ID;
else
return 0;