Making WordPress.org


Ignore:
Timestamp:
08/19/2020 03:00:42 AM (6 years ago)
Author:
dd32
Message:

Theme Directory: API: Only unique numeric arrays.

Follow up to [10177].
Props kafleg for noticing.
Fixes singular theme pages not working with cold caches.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r10177 r10179  
    928928                }
    929929
    930                 return array_unique( $input );
     930                // Only unique if it's a non-associative array.
     931                if ( wp_is_numeric_array( $input ) ) {
     932                        $input = array_unique( $input );
     933                }
     934
     935                return $input;
    931936        }
    932937}
Note: See TracChangeset for help on using the changeset viewer.