wp/wp-admin/media-upload.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- a/wp/wp-admin/media-upload.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-admin/media-upload.php	Mon Oct 14 18:28:13 2019 +0200
@@ -9,8 +9,9 @@
  * @subpackage Administration
  */
 
-if ( ! isset( $_GET['inline'] ) )
-	define( 'IFRAME_REQUEST' , true );
+if ( ! isset( $_GET['inline'] ) ) {
+	define( 'IFRAME_REQUEST', true );
+}
 
 /** Load WordPress Administration Bootstrap */
 require_once( dirname( __FILE__ ) . '/admin.php' );
@@ -19,20 +20,20 @@
 	wp_die( __( 'Sorry, you are not allowed to upload files.' ), 403 );
 }
 
-wp_enqueue_script('plupload-handlers');
-wp_enqueue_script('image-edit');
-wp_enqueue_script('set-post-thumbnail' );
-wp_enqueue_style('imgareaselect');
+wp_enqueue_script( 'plupload-handlers' );
+wp_enqueue_script( 'image-edit' );
+wp_enqueue_script( 'set-post-thumbnail' );
+wp_enqueue_style( 'imgareaselect' );
 wp_enqueue_script( 'media-gallery' );
 
-@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
+@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
 
 // IDs should be integers
-$ID = isset($ID) ? (int) $ID : 0;
-$post_id = isset($post_id)? (int) $post_id : 0;
+$ID      = isset( $ID ) ? (int) $ID : 0;
+$post_id = isset( $post_id ) ? (int) $post_id : 0;
 
 // Require an ID for the edit screen.
-if ( isset( $action ) && $action == 'edit' && !$ID ) {
+if ( isset( $action ) && $action == 'edit' && ! $ID ) {
 	wp_die(
 		'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
 		'<p>' . __( 'Invalid item ID.' ) . '</p>',
@@ -40,7 +41,7 @@
 	);
 }
 
-if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) {
+if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {
 	wp_die(
 		'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
 		'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
@@ -49,8 +50,8 @@
 }
 
 // Upload type: image, video, file, ..?
-if ( isset($_GET['type']) ) {
-	$type = strval($_GET['type']);
+if ( isset( $_GET['type'] ) ) {
+	$type = strval( $_GET['type'] );
 } else {
 	/**
 	 * Filters the default media upload type in the legacy (pre-3.5.0) media popup.
@@ -64,8 +65,8 @@
 }
 
 // Tab: gallery, library, or type-specific.
-if ( isset($_GET['tab']) ) {
-	$tab = strval($_GET['tab']);
+if ( isset( $_GET['tab'] ) ) {
+	$tab = strval( $_GET['tab'] );
 } else {
 	/**
 	 * Filters the default tab in the legacy (pre-3.5.0) media popup.
@@ -80,7 +81,7 @@
 $body_id = 'media-upload';
 
 // Let the action code decide how to handle the request.
-if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) ) {
+if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab, media_upload_tabs() ) ) {
 	/**
 	 * Fires inside specific upload-type views in the legacy (pre-3.5.0)
 	 * media popup based on the current tab.