Make WordPress Core

Ticket #28436: 28436.diff

File 28436.diff, 1.7 KB (added by pauldewouters, 10 years ago)
  • src/wp-includes/class-wp-theme.php

    diff --git src/wp-includes/class-wp-theme.php src/wp-includes/class-wp-theme.php
    index 523c733..3b80657 100644
    final class WP_Theme implements ArrayAccess { 
    11041104                /**
    11051105                 * Filter the array of themes allowed on the site or network.
    11061106                 *
    1107                  * @since MU
     1107                 * @since 4.2
    11081108                 *
    11091109                 * @param array $allowed_themes An array of theme stylesheet names.
    11101110                 */
    1111                 $network = (array) apply_filters( 'allowed_themes', self::get_allowed_on_network() );
     1111                $network = (array) apply_filters( 'allowed_themes_combined', self::get_allowed_on_network(), $blog_id );
    11121112                return $network + self::get_allowed_on_site( $blog_id );
    11131113        }
    11141114
    final class WP_Theme implements ArrayAccess { 
    11221122         */
    11231123        public static function get_allowed_on_network() {
    11241124                static $allowed_themes;
    1125                 if ( ! isset( $allowed_themes ) )
    1126                         $allowed_themes = (array) get_site_option( 'allowedthemes' );
     1125                if ( ! isset( $allowed_themes ) ) {
     1126                        /**
     1127                         * Filter the array of themes allowed on the network.
     1128                         *
     1129                         * @since 4.2
     1130                         *
     1131                         * @param array $allowed_themes An array of theme stylesheet names.
     1132                         */
     1133                        $allowed_themes = (array) apply_filters( 'allowed_themes', get_site_option( 'allowedthemes' ) );
     1134                }
    11271135                return $allowed_themes;
    11281136        }
    11291137
    final class WP_Theme implements ArrayAccess { 
    11911199                        }
    11921200                }
    11931201
    1194                 return (array) $allowed_themes[ $blog_id ];
     1202                /**
     1203                 * Filter the array of themes allowed on the site.
     1204                 *
     1205                 * @since 4.2
     1206                 *
     1207                 * @param array $allowed_themes An array of theme stylesheet names.
     1208                 */
     1209                $allowed_themes = (array) apply_filters( 'allowed_themes_site', $allowed_themes[ $blog_id ], $blog_id );
     1210                return $allowed_themes;
    11951211        }
    11961212
    11971213        /**