diff -r c7c34916027a -r 177826044cd9 wp/wp-admin/media-new.php --- a/wp/wp-admin/media-new.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-admin/media-new.php Mon Oct 14 18:28:13 2019 +0200 @@ -12,21 +12,23 @@ /** Load WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); -if (!current_user_can('upload_files')) - wp_die(__('Sorry, you are not allowed to upload files.')); +if ( ! current_user_can( 'upload_files' ) ) { + wp_die( __( 'Sorry, you are not allowed to upload files.' ) ); +} -wp_enqueue_script('plupload-handlers'); +wp_enqueue_script( 'plupload-handlers' ); $post_id = 0; if ( isset( $_REQUEST['post_id'] ) ) { $post_id = absint( $_REQUEST['post_id'] ); - if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) + if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) { $post_id = 0; + } } if ( $_POST ) { - if ( isset($_POST['html-upload']) && !empty($_FILES) ) { - check_admin_referer('media-form'); + if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) { + check_admin_referer( 'media-form' ); // Upload File button was clicked $upload_id = media_handle_upload( 'async-upload', $post_id ); if ( is_wp_error( $upload_id ) ) { @@ -37,37 +39,40 @@ exit; } -$title = __('Upload New Media'); +$title = __( 'Upload New Media' ); $parent_file = 'upload.php'; -get_current_screen()->add_help_tab( array( -'id' => 'overview', -'title' => __('Overview'), -'content' => - '
' . __('You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:') . '
' . - '' . __( 'You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:' ) . '
' . + '' . __('For more information:') . '
' . - '' . __('Documentation on Uploading Media Files') . '
' . - '' . __('Support Forums') . '
' + '' . __( 'For more information:' ) . '
' . + '' . __( 'Documentation on Uploading Media Files' ) . '
' . + '' . __( 'Support' ) . '
' ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); $form_class = 'media-upload-form type-form validate'; -if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) ) +if ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) { $form_class .= ' html-uploader'; +} ?>