mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Use is_singular in url_to_postid(). See #15771
git-svn-id: http://svn.automattic.com/wordpress/trunk@16877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bbbf5dcff5
commit
5bc9f1051c
@ -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