--- a/wp/wp-admin/includes/class-wp-theme-install-list-table.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/includes/class-wp-theme-install-list-table.php Fri Sep 05 18:40:08 2025 +0200
@@ -11,7 +11,6 @@
* Core class used to implement displaying themes to install in a list table.
*
* @since 3.1.0
- * @access private
*
* @see WP_Themes_List_Table
*/
@@ -37,7 +36,8 @@
require ABSPATH . 'wp-admin/includes/theme-install.php';
global $tabs, $tab, $paged, $type, $theme_field_defaults;
- wp_reset_vars( array( 'tab' ) );
+
+ $tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : '';
$search_terms = array();
$search_string = '';
@@ -186,12 +186,14 @@
$display_tabs = array();
foreach ( (array) $tabs as $action => $text ) {
- $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : '';
- $href = self_admin_url( 'theme-install.php?tab=' . $action );
- $display_tabs[ 'theme-install-' . $action ] = "<a href='$href'$current_link_attributes>$text</a>";
+ $display_tabs[ 'theme-install-' . $action ] = array(
+ 'url' => self_admin_url( 'theme-install.php?tab=' . $action ),
+ 'label' => $text,
+ 'current' => $action === $tab,
+ );
}
- return $display_tabs;
+ return $this->get_views_links( $display_tabs );
}
/**
@@ -332,7 +334,7 @@
esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
/* translators: %s: Theme name. */
esc_attr( sprintf( _x( 'Install %s', 'theme' ), $name ) ),
- __( 'Install Now' )
+ _x( 'Install Now', 'theme' )
);
break;
}
@@ -543,7 +545,7 @@
}
/**
- * Check to see if the theme is already installed.
+ * Checks to see if the theme is already installed.
*
* @since 3.4.0
*