src/wp-admin/media-new.php 1 location
|
@@ 21-25 (lines=5) @@
|
| 18 |
|
wp_enqueue_script('plupload-handlers'); |
| 19 |
|
|
| 20 |
|
$post_id = 0; |
| 21 |
|
if ( isset( $_REQUEST['post_id'] ) ) { |
| 22 |
|
$post_id = absint( $_REQUEST['post_id'] ); |
| 23 |
|
if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) |
| 24 |
|
$post_id = 0; |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
if ( $_POST ) { |
| 28 |
|
if ( isset($_POST['html-upload']) && !empty($_FILES) ) { |
src/wp-admin/async-upload.php 1 location
|
@@ 85-89 (lines=5) @@
|
| 82 |
|
check_admin_referer('media-form'); |
| 83 |
|
|
| 84 |
|
$post_id = 0; |
| 85 |
|
if ( isset( $_REQUEST['post_id'] ) ) { |
| 86 |
|
$post_id = absint( $_REQUEST['post_id'] ); |
| 87 |
|
if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) |
| 88 |
|
$post_id = 0; |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
$id = media_handle_upload( 'async-upload', $post_id ); |
| 92 |
|
if ( is_wp_error($id) ) { |