Make WordPress Core

Changeset 57796


Ignore:
Timestamp:
03/09/2024 06:05:27 PM (8 months ago)
Author:
SergeyBiryukov
Message:

Upload: Move an assignment in wp-admin/upload.php into a conditional branch.

This is a micro-optimization to reduce unnecessary memory allocation.

Follow-up to [28682].

Props mujuonly, swissspidy, mukesh27.
Fixes #60683.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/upload.php

    r56663 r57796  
    129129}
    130130
    131 $mode  = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
    132131$modes = array( 'grid', 'list' );
    133132
     
    135134    $mode = $_GET['mode'];
    136135    update_user_option( get_current_user_id(), 'media_library_mode', $mode );
     136} else {
     137    $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
    137138}
    138139
Note: See TracChangeset for help on using the changeset viewer.