Prevent a notice if $_REQUEST['post_id'] is missing. Just use 0 in this case, which will be the same as using intval on an undefined value.

git-svn-id: https://develop.svn.wordpress.org/trunk@14987 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2010-05-27 11:42:46 +00:00
parent 86f16a1881
commit de9e77a9c6
1 changed files with 1 additions and 1 deletions

View File

@ -1532,7 +1532,7 @@ SWFUpload.onload = function() {
function media_upload_type_form($type = 'file', $errors = null, $id = null) {
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
$post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);