Upload: Add links back to installer pages.

This adds a link back to the plugin or theme installers when an incompatible archive error message is encountered.

Props Presskopp, swissspidy, smub, pmbaldha, aneeshd16.
Fixes #60578.
Built from https://develop.svn.wordpress.org/trunk@57786


git-svn-id: http://core.svn.wordpress.org/trunk@57287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2024-03-07 05:58:15 +00:00
parent 4d6941a48b
commit 316d1efa23
2 changed files with 19 additions and 2 deletions

View File

@ -72,7 +72,24 @@ class File_Upload_Upgrader {
if ( 'pluginzip' === $form || 'themezip' === $form ) {
if ( ! wp_zip_file_is_valid( $file['file'] ) ) {
wp_delete_file( $file['file'] );
wp_die( __( 'Incompatible Archive.' ) );
if ( 'pluginzip' === $form ) {
$plugins_page = sprintf(
'<a href="%s">%s</a>',
self_admin_url( 'plugin-install.php' ),
__( 'Return to the Plugin Installer' )
);
wp_die( __( 'Incompatible Archive.' ) . '<br />' . $plugins_page );
}
if ( 'themezip' === $form ) {
$themes_page = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'theme-install.php' ),
__( 'Return to the Theme Installer' )
);
wp_die( __( 'Incompatible Archive.' ) . '<br />' . $themes_page );
}
}
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-57785';
$wp_version = '6.6-alpha-57786';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.