summaryrefslogtreecommitdiffstats
path: root/wp-admin/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/upload.php')
-rw-r--r--wp-admin/upload.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/wp-admin/upload.php b/wp-admin/upload.php
index 3c48cc9..8267ad5 100644
--- a/wp-admin/upload.php
+++ b/wp-admin/upload.php
@@ -128,12 +128,13 @@ if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message' ), $_SERVER['REQUEST_URI'] );
}
-$mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
$modes = array( 'grid', 'list' );
if ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], $modes, true ) ) {
$mode = $_GET['mode'];
update_user_option( get_current_user_id(), 'media_library_mode', $mode );
+} else {
+ $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
}
if ( 'grid' === $mode ) {