Making WordPress.org

Changeset 10443


Ignore:
Timestamp:
11/12/2020 06:31:48 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: i18n: A second attempt at cache back-compat handling.

Amends r10442.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php

    r10442 r10443  
    176176
    177177        if ( false !== ( $originals = $this->cache_get( $slug, $branch, $cache_suffix ) ) ) {
    178             if ( isset( $originals[0] ) ) {
    179                 // old cache style.
    180                 foreach ( $originals as $i => $o ) {
    181                     $originals[ $o->id ] = $o->singular;
    182                     unset( $originals[ $i ] ); // Safe: Original IDs are huge for plugins.
    183                 }
     178            if ( $originals && is_object( $originals[ array_keys($originals)[0] ] ) ) {
     179                $originals = array_column( $originals, 'singular', 'id' );
    184180            }
    185181
Note: See TracChangeset for help on using the changeset viewer.