Make WordPress Core

Ticket #60644: final.patch

File final.patch, 1.6 KB (added by karthickmurugan, 3 months ago)

Final Patch file for adding "Go to Theme Installer" link if theme installation fails.

  • wp-admin/includes/class-theme-upgrader.php

     
    8080                $this->strings['no_files']            = __( 'The theme contains no files.' );
    8181                $this->strings['process_failed']      = __( 'Theme installation failed.' );
    8282                $this->strings['process_success']     = __( 'Theme installed successfully.' );
     83                $this->strings['return_to_installer'] = sprintf(
     84                        /* translators: %s: Return link. */
     85                        __( '%s' ),
     86                        '<a href="' . esc_url( admin_url( 'theme-install.php' ) ) . '">' . esc_html__( 'Go to Theme Installer' ) . '</a>'
     87                );
    8388                /* translators: 1: Theme name, 2: Theme version. */
    8489                $this->strings['process_success_specific'] = __( 'Successfully installed the theme <strong>%1$s %2$s</strong>.' );
    8590                $this->strings['parent_theme_search']      = __( 'This theme requires a parent theme. Checking if it is installed&#8230;' );
  • wp-admin/includes/class-wp-upgrader.php

     
    939939
    940940                        if ( ! method_exists( $this->skin, 'hide_process_failed' ) || ! $this->skin->hide_process_failed( $result ) ) {
    941941                                $this->skin->feedback( 'process_failed' );
     942                                if ( $this instanceof Theme_Upgrader ) {
     943                                        $this->skin->feedback( 'return_to_installer' );
     944                                }
    942945                        }
    943946                } else {
    944947                        // Installation succeeded.