Make WordPress Core

Ticket #27869: 27869.patch

File 27869.patch, 2.0 KB (added by ocean90, 11 years ago)
  • src/wp-admin/includes/ajax-actions.php

     
    22172217                wp_send_json_error();
    22182218        }
    22192219
    2220         $args = wp_parse_args( wp_unslash( $_REQUEST['request'] ), array(
     2220        $request = wp_unslash( $_REQUEST['request'] );
     2221        $is_network = $request['is_network'];
     2222        unset( $request['is_network'] );
     2223
     2224        $args = wp_parse_args( $request, array(
    22212225                'per_page' => 20,
    22222226                'fields'   => $theme_field_defaults
    22232227        ) );
     
    22332237                wp_send_json_error();
    22342238        }
    22352239
    2236         $update_php = self_admin_url( 'update.php?action=install-theme' );
     2240        $update_php = $is_network ? network_admin_url( 'update.php?action=install-theme' ) : admin_url( 'update.php?action=install-theme' );
    22372241        foreach ( $api->themes as &$theme ) {
    22382242                $theme->install_url = add_query_arg( array(
    22392243                        'theme'    => $theme->slug,
  • src/wp-admin/js/theme.js

     
    318318                        data: {
    319319                        // Request data
    320320                                request: _.extend({
     321                                        is_network: themes.data.settings.isNetwork,
    321322                                        per_page: 100,
    322323                                        fields: {
    323324                                                description: true,
  • src/wp-admin/theme-install.php

     
    4646                'isInstall'     => true,
    4747                'canInstall'    => current_user_can( 'install_themes' ),
    4848                'installURI'    => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
    49                 'adminUrl'      => parse_url( self_admin_url(), PHP_URL_PATH )
     49                'adminUrl'      => parse_url( self_admin_url(), PHP_URL_PATH ),
     50                'isNetwork'     => is_network_admin()
    5051        ),
    5152        'l10n' => array(
    5253                'addNew' => __( 'Add New Theme' ),