Assume unattached attachments are published. fixes #12999
git-svn-id: https://develop.svn.wordpress.org/trunk@14087 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2e60fb8e0e
commit
b9bdd0bfb1
|
@ -468,14 +468,17 @@ function get_post_mime_type($ID = '') {
|
||||||
function get_post_status($ID = '') {
|
function get_post_status($ID = '') {
|
||||||
$post = get_post($ID);
|
$post = get_post($ID);
|
||||||
|
|
||||||
if ( is_object($post) ) {
|
if ( !is_object($post) )
|
||||||
if ( ('attachment' == $post->post_type) && $post->post_parent && ($post->ID != $post->post_parent) )
|
return false;
|
||||||
return get_post_status($post->post_parent);
|
|
||||||
else
|
|
||||||
return $post->post_status;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
// Unattached attachments are assumed to be published.
|
||||||
|
if ( ('attachment' == $post->post_type) && ('inherit' == $post->post_status) && ( 0 == $post->post_parent) )
|
||||||
|
return 'publish';
|
||||||
|
|
||||||
|
if ( ('attachment' == $post->post_type) && $post->post_parent && ($post->ID != $post->post_parent) )
|
||||||
|
return get_post_status($post->post_parent);
|
||||||
|
|
||||||
|
return $post->post_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue