diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/includes/class-wp-theme-install-list-table.php --- a/wp/wp-admin/includes/class-wp-theme-install-list-table.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/includes/class-wp-theme-install-list-table.php Tue Dec 15 13:49:49 2020 +0100 @@ -34,7 +34,7 @@ * @global array $theme_field_defaults */ public function prepare_items() { - include( ABSPATH . 'wp-admin/includes/theme-install.php' ); + require ABSPATH . 'wp-admin/includes/theme-install.php'; global $tabs, $tab, $paged, $type, $theme_field_defaults; wp_reset_vars( array( 'tab' ) ); @@ -82,7 +82,7 @@ $nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs ); // If a non-valid menu tab has been selected, And it's not a non-menu action. - if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) ) { + if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) { $tab = key( $tabs ); } @@ -137,7 +137,7 @@ * * @since 3.7.0 * - * @param array $args An array of themes API arguments. + * @param array|false $args Theme install API arguments. */ $args = apply_filters( "install_themes_table_api_args_{$tab}", $args ); @@ -148,7 +148,7 @@ $api = themes_api( 'query_themes', $args ); if ( is_wp_error( $api ) ) { - wp_die( $api->get_error_message() . '

' . __( 'Try again' ) . '' ); + wp_die( $api->get_error_message() . '

' . __( 'Try Again' ) . '' ); } $this->items = $api->themes; @@ -187,6 +187,11 @@ } /** + * Displays the theme install table. + * + * Overrides the parent display() method to provide a different container. + * + * @since 3.1.0 */ public function display() { wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' ); @@ -226,7 +231,7 @@ ?> theme_installer(); } @@ -241,15 +246,15 @@ * @param object $theme { * An object that contains theme data returned by the WordPress.org API. * - * @type string $name Theme name, e.g. 'Twenty Nineteen'. - * @type string $slug Theme slug, e.g. 'twentynineteen'. + * @type string $name Theme name, e.g. 'Twenty Twenty'. + * @type string $slug Theme slug, e.g. 'twentytwenty'. * @type string $version Theme version, e.g. '1.1'. * @type string $author Theme author username, e.g. 'melchoyce'. - * @type string $preview_url Preview URL, e.g. 'http://2019.wordpress.net/'. - * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentynineteen/'. + * @type string $preview_url Preview URL, e.g. 'https://2020.wordpress.net/'. + * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwenty/'. * @type float $rating Rating score. * @type int $num_ratings The number of ratings. - * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentynineteen/'. + * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentytwenty/'. * @type string $description Theme description. * @type string $download_link Theme ZIP download URL. * } @@ -264,7 +269,7 @@ $name = wp_kses( $theme->name, $themes_allowedtags ); $author = wp_kses( $theme->author, $themes_allowedtags ); - /* translators: %s: theme name */ + /* translators: %s: Theme name. */ $preview_title = sprintf( __( 'Preview “%s”' ), $name ); $preview_url = add_query_arg( array( @@ -299,7 +304,7 @@ $actions[] = sprintf( '%s', esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ), - /* translators: %s: theme version */ + /* translators: %s: Theme version. */ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ), __( 'Update' ) ); @@ -317,8 +322,8 @@ $actions[] = sprintf( '%s', esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ), - /* translators: %s: theme name */ - esc_attr( sprintf( __( 'Install %s' ), $name ) ), + /* translators: %s: Theme name. */ + esc_attr( sprintf( _x( 'Install %s', 'theme' ), $name ) ), __( 'Install Now' ) ); break; @@ -327,7 +332,7 @@ $actions[] = sprintf( '%s', esc_url( $preview_url ), - /* translators: %s: theme name */ + /* translators: %s: Theme name. */ esc_attr( sprintf( __( 'Preview %s' ), $name ) ), __( 'Preview' ) ); @@ -351,7 +356,7 @@

@@ -457,7 +462,7 @@ printf( '%s', esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ), - /* translators: %s: theme version */ + /* translators: %s: Theme version. */ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ), __( 'Update' ) ); @@ -483,7 +488,7 @@