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:
parent
dfb1f77e3b
commit
9c1dd77de9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user