WordPress.org

Make WordPress Core

Ticket #20103: wp_get_themes-cleanup.diff

File wp_get_themes-cleanup.diff, 1.1 KB (added by duck_, 6 years ago)

See [20152] and [20029]

  • wp-includes/theme.php

     
    5050        if ( is_multisite() && null !== $args['allowed'] ) {
    5151                $allowed = $args['allowed'];
    5252                if ( 'network' === $allowed )
    53                         $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_network( $args['blog_id'] ) );
     53                        $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_network() );
    5454                elseif ( 'site' === $allowed )
    5555                        $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_site( $args['blog_id'] ) );
    5656                elseif ( $allowed )
     
    6262        $themes = array();
    6363
    6464        foreach ( $theme_directories as $theme => $theme_root ) {
    65                 if ( isset( $_themes[ $theme ] ) )
    66                         $themes[ $theme ] = $_themes[ $theme ];
    67                 else
    68                         $themes[ $theme ] = $_themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );
     65                $themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );
    6966        }
    7067
    7168        if ( null !== $args['errors'] ) {