WordPress.org

Make WordPress Core

Ticket #21099: 21099.3.patch

File 21099.3.patch, 1.1 KB (added by SergeyBiryukov, 6 years ago)
  • wp-includes/class-wp-theme.php

     
    10711071         * @return array Array of stylesheet names.
    10721072         */
    10731073        public static function get_allowed( $blog_id = null ) {
    1074                 return self::get_allowed_on_network() + self::get_allowed_on_site( $blog_id );
     1074                $allowed_on_network = (array) apply_filters( 'allowed_themes', self::get_allowed_on_network() );
     1075                return $allowed_on_network + self::get_allowed_on_site( $blog_id );
    10751076        }
    10761077
    10771078        /**
     
    10851086        public static function get_allowed_on_network() {
    10861087                static $allowed_themes;
    10871088                if ( ! isset( $allowed_themes ) )
    1088                         $allowed_themes = (array) get_site_option( 'allowedthemes' );
     1089                        $allowed_themes = (array) apply_filters( 'network_allowed_themes', get_site_option( 'allowedthemes' ) );
    10891090                return $allowed_themes;
    10901091        }
    10911092
     
    11451146                        }
    11461147                }
    11471148
    1148                 return (array) $allowed_themes[ $blog_id ];
     1149                return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );
    11491150        }
    11501151
    11511152        /**