Clean up remnants from having negative Post_IDs, props markjaquith, fixes #18235

git-svn-id: https://develop.svn.wordpress.org/trunk@18823 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2011-09-29 21:47:52 +00:00
parent 25df5fe335
commit b969d2ea80
4 changed files with 13 additions and 55 deletions
+4 -2
View File
@@ -401,12 +401,14 @@ function _media_button($title, $icon, $type, $id) {
}
function get_upload_iframe_src($type) {
global $post_ID, $temp_ID;
$uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
global $post_ID;
$uploading_iframe_ID = (int) $post_ID;
$upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') );
if ( 'media' != $type )
$upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src);
$upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src);
return add_query_arg('TB_iframe', true, $upload_iframe_src);