X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4713a14935b83517997f3c88f808eb41da55033d..ac7339a398e6df50f722bc9616291ce5447d8e5e:/wp-admin/theme-install.php diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 088feed4..56c20b58 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -27,12 +27,6 @@ if ( ! is_network_admin() ) { $submenu_file = 'themes.php'; } -$sections = array( - 'featured' => __( 'Featured Themes' ), - 'popular' => __( 'Popular Themes' ), - 'new' => __( 'Newest Themes' ), -); - $installed_themes = search_theme_directories(); foreach ( $installed_themes as $k => $v ) { if ( false !== strpos( $k, '/' ) ) { @@ -50,36 +44,36 @@ wp_localize_script( 'theme', '_wpThemeSettings', array( ), 'l10n' => array( 'addNew' => __( 'Add New Theme' ), - 'search' => __( 'Search Themes' ), + 'search' => __( 'Search Themes' ), 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis) 'upload' => __( 'Upload Theme' ), 'back' => __( 'Back' ), - 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ) + 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ), + 'themesFound' => __( 'Number of Themes found: %d' ), + 'noThemesFound' => __( 'No themes found. Try a different search.' ), ), 'installedThemes' => array_keys( $installed_themes ), - 'browse' => array( - 'sections' => $sections, - ), ) ); wp_enqueue_script( 'theme' ); -/** - * Fires before each of the tabs are rendered on the Install Themes page. - * - * The dynamic portion of the hook name, $tab, refers to the current - * theme install tab. Possible values are 'dashboard', 'search', 'upload', - * 'featured', 'new', or 'updated'. - * - * @since 2.8.0 - */ if ( $tab ) { + /** + * Fires before each of the tabs are rendered on the Install Themes page. + * + * The dynamic portion of the hook name, `$tab`, refers to the current + * theme install tab. Possible values are 'dashboard', 'search', 'upload', + * 'featured', 'new', or 'updated'. + * + * @since 2.8.0 + */ do_action( "install_themes_pre_{$tab}" ); } $help_overview = '

' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the WordPress.org Theme Directory. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.'), 'https://wordpress.org/themes/') . '

' . - '

' . __('You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter. Alternately, you can browse the themes that are Featured, Newest, or Recently Updated. When you find a theme you like, you can preview it or install it.') . '

' . + '

' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' ' . __( 'The search results will be updated as you type.' ) . '

' . + '

' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '

' . '

' . __('You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your /wp-content/themes directory.') . '

'; get_current_screen()->add_help_tab( array( @@ -100,7 +94,7 @@ get_current_screen()->add_help_tab( array( get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Adding New Themes') . '

' . + '

' . __('Documentation on Adding New Themes') . '

' . '

' . __('Support Forums') . '

' ); @@ -108,58 +102,74 @@ include(ABSPATH . 'wp-admin/admin-header.php'); ?>
-

- - - -

+

__( 'Upload Theme' ) ) ); + if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) { + echo ' ' . __( 'Upload Theme' ) . ''; + echo ' ' . _x( 'Browse', 'themes' ) . ''; + } + ?>

-
- - - - -
- - +
+
+
-
- - -
+ + + + + +
+ +
+
+ + +
$features ) { - if ( $feature_name === 'Features' || $feature_name === __( 'Features' ) ) { // hack hack hack - echo '
'; - } else { - echo '
'; - } + echo '
'; $feature_name = esc_html( $feature_name ); - echo '

' . $feature_name . '

'; + echo '

' . $feature_name . '

'; echo '
    '; foreach ( $features as $feature => $feature_name ) { $feature = esc_attr( $feature ); - echo '
  1. '; - echo '
  2. '; + echo '
  3. '; + echo '
  4. '; } echo '
'; echo '
'; } ?> -
+
-
+

@@ -167,18 +177,18 @@ include(ABSPATH . 'wp-admin/admin-header.php');
@@ -202,16 +212,18 @@ if ( $tab ) {
<# if ( data.installed ) { #> -
+
<# } #>