[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/ -> theme-install.php (source)

   1  <?php
   2  /**
   3   * Install theme administration panel.
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   */
   8  
   9  /** WordPress Administration Bootstrap */
  10  require_once  __DIR__ . '/admin.php';
  11  require  ABSPATH . 'wp-admin/includes/theme-install.php';
  12  
  13  $tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : '';
  14  
  15  if ( ! current_user_can( 'install_themes' ) ) {
  16      wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
  17  }
  18  
  19  if ( is_multisite() && ! is_network_admin() ) {
  20      wp_redirect( network_admin_url( 'theme-install.php' ) );
  21      exit;
  22  }
  23  
  24  // Used in the HTML title tag.
  25  $title       = __( 'Add Themes' );
  26  $parent_file = 'themes.php';
  27  
  28  if ( ! is_network_admin() ) {
  29      $submenu_file = 'themes.php';
  30  }
  31  
  32  $installed_themes = search_theme_directories();
  33  
  34  if ( false === $installed_themes ) {
  35      $installed_themes = array();
  36  }
  37  
  38  foreach ( $installed_themes as $theme_slug => $theme_data ) {
  39      // Ignore child themes.
  40      if ( str_contains( $theme_slug, '/' ) ) {
  41          unset( $installed_themes[ $theme_slug ] );
  42      }
  43  }
  44  
  45  wp_localize_script(
  46      'theme',
  47      '_wpThemeSettings',
  48      array(
  49          'themes'          => false,
  50          'settings'        => array(
  51              'isInstall'  => true,
  52              'canInstall' => current_user_can( 'install_themes' ),
  53              'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
  54              'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH ),
  55          ),
  56          'l10n'            => array(
  57              'addNew'              => __( 'Add Theme' ),
  58              'search'              => __( 'Search Themes' ),
  59              'upload'              => __( 'Upload Theme' ),
  60              'back'                => __( 'Back' ),
  61              'error'               => sprintf(
  62                  /* translators: %s: Support forums URL. */
  63                  __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
  64                  __( 'https://wordpress.org/support/forums/' )
  65              ),
  66              'tryAgain'            => __( 'Try Again' ),
  67              /* translators: %d: Number of themes. */
  68              'themesFound'         => __( 'Number of Themes found: %d' ),
  69              'noThemesFound'       => __( 'No themes found. Try a different search.' ),
  70              /* translators: %s: Theme name. */
  71              'themeViewed'         => __( 'Theme details: %s' ),
  72              'collapseSidebar'     => __( 'Collapse Sidebar' ),
  73              'expandSidebar'       => __( 'Expand Sidebar' ),
  74              /* translators: Hidden accessibility text. */
  75              'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
  76          ),
  77          'installedThemes' => array_keys( $installed_themes ),
  78          'activeTheme'     => get_stylesheet(),
  79      )
  80  );
  81  
  82  wp_enqueue_script( 'theme' );
  83  wp_enqueue_script( 'updates' );
  84  
  85  if ( $tab ) {
  86      /**
  87       * Fires before each of the tabs are rendered on the Install Themes page.
  88       *
  89       * The dynamic portion of the hook name, `$tab`, refers to the current
  90       * theme installation tab.
  91       *
  92       * Possible hook names include:
  93       *
  94       *  - `install_themes_pre_block-themes`
  95       *  - `install_themes_pre_dashboard`
  96       *  - `install_themes_pre_featured`
  97       *  - `install_themes_pre_new`
  98       *  - `install_themes_pre_search`
  99       *  - `install_themes_pre_updated`
 100       *  - `install_themes_pre_upload`
 101       *
 102       * @since 2.8.0
 103       * @since 6.1.0 Added the `install_themes_pre_block-themes` hook name.
 104       */
 105      do_action( "install_themes_pre_{$tab}" );
 106  }
 107  
 108  $help_overview =
 109      '<p>' . sprintf(
 110          /* translators: %s: Theme Directory URL. */
 111          __( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
 112          __( 'https://wordpress.org/themes/' )
 113      ) . '</p>' .
 114      '<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
 115      '<p>' . __( 'Alternately, you can browse the themes that are Popular or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
 116      '<p>' . sprintf(
 117          /* translators: %s: /wp-content/themes */
 118          __( '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&#8217;s folder via FTP into your %s directory.' ),
 119          '<code>/wp-content/themes</code>'
 120      ) . '</p>';
 121  
 122  get_current_screen()->add_help_tab(
 123      array(
 124          'id'      => 'overview',
 125          'title'   => __( 'Overview' ),
 126          'content' => $help_overview,
 127      )
 128  );
 129  
 130  $help_installing =
 131      '<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you are interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' .
 132      '<p>' . __( 'To install the theme so you can preview it with your site&#8217;s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme&#8217;s thumbnail image.' ) . '</p>';
 133  
 134  get_current_screen()->add_help_tab(
 135      array(
 136          'id'      => 'installing',
 137          'title'   => __( 'Previewing and Installing' ),
 138          'content' => $help_installing,
 139      )
 140  );
 141  
 142  // Help tab: Block themes.
 143  $help_block_themes =
 144      '<p>' . __( 'A block theme is a theme that uses blocks for all parts of a site including navigation menus, header, content, and site footer. These themes are built for the features that allow you to edit and customize all parts of your site.' ) . '</p>' .
 145      '<p>' . __( 'With a block theme, you can place and edit blocks without affecting your content by customizing or creating new templates.' ) . '</p>';
 146  
 147  get_current_screen()->add_help_tab(
 148      array(
 149          'id'      => 'block_themes',
 150          'title'   => __( 'Block themes' ),
 151          'content' => $help_block_themes,
 152      )
 153  );
 154  
 155  get_current_screen()->set_help_sidebar(
 156      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
 157      '<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-themes-screen/#install-themes">Documentation on Adding New Themes</a>' ) . '</p>' .
 158      '<p>' . __( '<a href="https://wordpress.org/documentation/article/block-themes/">Documentation on Block Themes</a>' ) . '</p>' .
 159      '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
 160  );
 161  
 162  require_once  ABSPATH . 'wp-admin/admin-header.php';
 163  
 164  ?>
 165  <div class="wrap">
 166      <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
 167  
 168      <?php
 169  
 170      /**
 171       * Filters the tabs shown on the Add Themes screen.
 172       *
 173       * This filter is for backward compatibility only, for the suppression of the upload tab.
 174       *
 175       * @since 2.8.0
 176       *
 177       * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.
 178       */
 179      $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
 180      if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
 181          echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
 182      }
 183      ?>
 184  
 185      <hr class="wp-header-end">
 186  
 187      <?php
 188      wp_admin_notice(
 189          __( 'The Theme Installer screen requires JavaScript.' ),
 190          array(
 191              'additional_classes' => array( 'error', 'hide-if-js' ),
 192          )
 193      );
 194      ?>
 195  
 196      <div class="upload-theme">
 197      <?php install_themes_upload(); ?>
 198      </div>
 199  
 200      <h2 class="screen-reader-text hide-if-no-js">
 201          <?php
 202          /* translators: Hidden accessibility text. */
 203          _e( 'Filter themes list' );
 204          ?>
 205      </h2>
 206  
 207      <div class="wp-filter hide-if-no-js">
 208          <div class="filter-count">
 209              <span class="count theme-count"></span>
 210          </div>
 211  
 212          <ul class="filter-links">
 213              <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
 214              <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
 215              <li><a href="#" data-sort="block-themes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li>
 216              <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
 217          </ul>
 218  
 219          <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
 220  
 221          <form class="search-form"><p class="search-box"></p></form>
 222  
 223          <div class="favorites-form">
 224              <?php
 225              $action = 'save_wporg_username_' . get_current_user_id();
 226              if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
 227                  $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
 228                  update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
 229              } else {
 230                  $user = get_user_option( 'wporg_favorites' );
 231              }
 232              ?>
 233              <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
 234  
 235              <p class="favorites-username">
 236                  <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
 237                  <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
 238                  <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
 239                  <input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
 240              </p>
 241          </div>
 242  
 243          <div class="filter-drawer">
 244              <div class="buttons">
 245                  <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
 246                  <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
 247              </div>
 248          <?php
 249          // Use the core list, rather than the .org API, due to inconsistencies
 250          // and to ensure tags are translated.
 251          $feature_list = get_theme_feature_list( false );
 252  
 253          foreach ( $feature_list as $feature_group => $features ) {
 254              echo '<fieldset class="filter-group">';
 255              echo '<legend>' . esc_html( $feature_group ) . '</legend>';
 256              echo '<div class="filter-group-feature">';
 257              foreach ( $features as $feature => $feature_name ) {
 258                  $feature = esc_attr( $feature );
 259                  echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
 260                  echo '<label for="filter-id-' . $feature . '">' . esc_html( $feature_name ) . '</label>';
 261              }
 262              echo '</div>';
 263              echo '</fieldset>';
 264          }
 265          ?>
 266              <div class="buttons">
 267                  <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
 268                  <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
 269              </div>
 270              <div class="filtered-by">
 271                  <span><?php _e( 'Filtering by:' ); ?></span>
 272                  <div class="tags"></div>
 273                  <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
 274              </div>
 275          </div>
 276      </div>
 277      <h2 class="screen-reader-text hide-if-no-js">
 278          <?php
 279          /* translators: Hidden accessibility text. */
 280          _e( 'Themes list' );
 281          ?>
 282      </h2>
 283      <div class="theme-browser content-filterable"></div>
 284      <div class="theme-install-overlay wp-full-overlay expanded"></div>
 285  
 286      <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
 287      <span class="spinner"></span>
 288  
 289  <?php
 290  if ( $tab ) {
 291      /**
 292       * Fires at the top of each of the tabs on the Install Themes page.
 293       *
 294       * The dynamic portion of the hook name, `$tab`, refers to the current
 295       * theme installation tab.
 296       *
 297       * Possible hook names include:
 298       *
 299       *  - `install_themes_block-themes`
 300       *  - `install_themes_dashboard`
 301       *  - `install_themes_featured`
 302       *  - `install_themes_new`
 303       *  - `install_themes_search`
 304       *  - `install_themes_updated`
 305       *  - `install_themes_upload`
 306       *
 307       * @since 2.8.0
 308       * @since 6.1.0 Added the `install_themes_block-themes` hook name.
 309       *
 310       * @param int $paged Number of the current page of results being viewed.
 311       */
 312      do_action( "install_themes_{$tab}", $paged );
 313  }
 314  ?>
 315  </div>
 316  
 317  <script id="tmpl-theme" type="text/template">
 318      <# if ( data.screenshot_url ) { #>
 319          <div class="theme-screenshot">
 320              <img src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
 321          </div>
 322      <# } else { #>
 323          <div class="theme-screenshot blank"></div>
 324      <# } #>
 325  
 326      <# if ( data.installed ) { #>
 327          <?php
 328          wp_admin_notice(
 329              _x( 'Installed', 'theme' ),
 330              array(
 331                  'type'               => 'success',
 332                  'additional_classes' => array( 'notice-alt' ),
 333              )
 334          );
 335          ?>
 336      <# } #>
 337  
 338      <# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
 339          <div class="notice notice-error notice-alt"><p>
 340              <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
 341                  <?php
 342                  _e( 'This theme does not work with your versions of WordPress and PHP.' );
 343                  if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
 344                      printf(
 345                          /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
 346                          ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
 347                          self_admin_url( 'update-core.php' ),
 348                          esc_url( wp_get_update_php_url() )
 349                      );
 350                      wp_update_php_annotation( '</p><p><em>', '</em>' );
 351                  } elseif ( current_user_can( 'update_core' ) ) {
 352                      printf(
 353                          /* translators: %s: URL to WordPress Updates screen. */
 354                          ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 355                          self_admin_url( 'update-core.php' )
 356                      );
 357                  } elseif ( current_user_can( 'update_php' ) ) {
 358                      printf(
 359                          /* translators: %s: URL to Update PHP page. */
 360                          ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 361                          esc_url( wp_get_update_php_url() )
 362                      );
 363                      wp_update_php_annotation( '</p><p><em>', '</em>' );
 364                  }
 365                  ?>
 366              <# } else if ( ! data.compatible_wp ) { #>
 367                  <?php
 368                  _e( 'This theme does not work with your version of WordPress.' );
 369                  if ( current_user_can( 'update_core' ) ) {
 370                      printf(
 371                          /* translators: %s: URL to WordPress Updates screen. */
 372                          ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 373                          self_admin_url( 'update-core.php' )
 374                      );
 375                  }
 376                  ?>
 377              <# } else if ( ! data.compatible_php ) { #>
 378                  <?php
 379                  _e( 'This theme does not work with your version of PHP.' );
 380                  if ( current_user_can( 'update_php' ) ) {
 381                      printf(
 382                          /* translators: %s: URL to Update PHP page. */
 383                          ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 384                          esc_url( wp_get_update_php_url() )
 385                      );
 386                      wp_update_php_annotation( '</p><p><em>', '</em>' );
 387                  }
 388                  ?>
 389              <# } #>
 390          </p></div>
 391      <# } #>
 392  
 393      <span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
 394      <div class="theme-author">
 395          <?php
 396          /* translators: %s: Theme author name. */
 397          printf( __( 'By %s' ), '{{ data.author }}' );
 398          ?>
 399      </div>
 400  
 401      <div class="theme-id-container">
 402          <h3 class="theme-name">{{ data.name }}</h3>
 403  
 404          <div class="theme-actions">
 405              <# if ( data.installed ) { #>
 406                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 407                      <?php
 408                      /* translators: %s: Theme name. */
 409                      $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 410                      ?>
 411                      <# if ( data.activate_url ) { #>
 412                          <# if ( ! data.active ) { #>
 413                              <a class="button button-primary button-compact activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
 414                          <# } else { #>
 415                              <button class="button button-primary button-compact disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
 416                          <# } #>
 417                      <# } #>
 418                      <# if ( data.customize_url ) { #>
 419                          <# if ( ! data.active ) { #>
 420                              <# if ( ! data.block_theme ) { #>
 421                                  <a class="button button-compact load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
 422                              <# } #>
 423                          <# } else { #>
 424                              <a class="button button-compact load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
 425                          <# } #>
 426                      <# } else { #>
 427                          <button class="button button-compact preview install-theme-preview"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
 428                      <# } #>
 429                  <# } else { #>
 430                      <?php
 431                      /* translators: %s: Theme name. */
 432                      $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
 433                      ?>
 434                      <# if ( data.activate_url ) { #>
 435                          <a class="button button-primary button-compact disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
 436                      <# } #>
 437                      <# if ( data.customize_url ) { #>
 438                          <a class="button button-compact disabled"><?php _e( 'Live Preview' ); ?></a>
 439                      <# } else { #>
 440                          <button class="button button-compact disabled"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
 441                      <# } #>
 442                  <# } #>
 443              <# } else { #>
 444                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 445                      <?php
 446                      /* translators: %s: Theme name. */
 447                      $aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
 448                      ?>
 449                      <a class="button button-primary button-compact theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
 450                      <button class="button button-compact preview install-theme-preview"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
 451                  <# } else { #>
 452                      <?php
 453                      /* translators: %s: Theme name. */
 454                      $aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
 455                      ?>
 456                      <a class="button button-primary button-compact disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
 457                      <button class="button button-compact disabled"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
 458                  <# } #>
 459              <# } #>
 460          </div>
 461      </div>
 462  </script>
 463  
 464  <script id="tmpl-theme-preview" type="text/template">
 465      <div class="wp-full-overlay-sidebar">
 466          <div class="wp-full-overlay-header">
 467              <button class="close-full-overlay"><span class="screen-reader-text">
 468                  <?php
 469                  /* translators: Hidden accessibility text. */
 470                  _e( 'Close' );
 471                  ?>
 472              </span></button>
 473              <button class="previous-theme"><span class="screen-reader-text">
 474                  <?php
 475                  /* translators: Hidden accessibility text. */
 476                  _e( 'Previous theme' );
 477                  ?>
 478              </span></button>
 479              <button class="next-theme"><span class="screen-reader-text">
 480                  <?php
 481                  /* translators: Hidden accessibility text. */
 482                  _e( 'Next theme' );
 483                  ?>
 484              </span></button>
 485              <# if ( data.installed ) { #>
 486                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 487                      <?php
 488                      /* translators: %s: Theme name. */
 489                      $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 490                      ?>
 491                      <# if ( ! data.active ) { #>
 492                          <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
 493                      <# } else { #>
 494                          <button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
 495                      <# } #>
 496                  <# } else { #>
 497                      <a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
 498                  <# } #>
 499              <# } else { #>
 500                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 501                      <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
 502                  <# } else { #>
 503                      <a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
 504                  <# } #>
 505              <# } #>
 506          </div>
 507          <div class="wp-full-overlay-sidebar-content">
 508              <div class="install-theme-info">
 509                  <h3 class="theme-name">{{ data.name }}</h3>
 510                      <span class="theme-by">
 511                          <?php
 512                          /* translators: %s: Theme author name. */
 513                          printf( __( 'By %s' ), '{{ data.author }}' );
 514                          ?>
 515                      </span>
 516  
 517                      <div class="theme-screenshot">
 518                          <img class="theme-screenshot" src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
 519                      </div>
 520  
 521                      <div class="theme-details">
 522                          <# if ( data.rating ) { #>
 523                              <div class="theme-rating">
 524                                  {{{ data.stars }}}
 525                                  <a class="num-ratings" href="{{ data.reviews_url }}">
 526                                      <?php
 527                                      /* translators: %s: Number of ratings. */
 528                                      printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
 529                                      ?>
 530                                  </a>
 531                              </div>
 532                          <# } else { #>
 533                              <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
 534                          <# } #>
 535  
 536                          <div class="theme-version">
 537                              <?php
 538                              /* translators: %s: Theme version. */
 539                              printf( __( 'Version: %s' ), '{{ data.version }}' );
 540                              ?>
 541                          </div>
 542  
 543                          <# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
 544                              <div class="notice notice-error notice-alt notice-large"><p>
 545                                  <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
 546                                      <?php
 547                                      _e( 'This theme does not work with your versions of WordPress and PHP.' );
 548                                      if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
 549                                          printf(
 550                                              /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
 551                                              ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
 552                                              self_admin_url( 'update-core.php' ),
 553                                              esc_url( wp_get_update_php_url() )
 554                                          );
 555                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 556                                      } elseif ( current_user_can( 'update_core' ) ) {
 557                                          printf(
 558                                              /* translators: %s: URL to WordPress Updates screen. */
 559                                              ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 560                                              self_admin_url( 'update-core.php' )
 561                                          );
 562                                      } elseif ( current_user_can( 'update_php' ) ) {
 563                                          printf(
 564                                              /* translators: %s: URL to Update PHP page. */
 565                                              ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 566                                              esc_url( wp_get_update_php_url() )
 567                                          );
 568                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 569                                      }
 570                                      ?>
 571                                  <# } else if ( ! data.compatible_wp ) { #>
 572                                      <?php
 573                                      _e( 'This theme does not work with your version of WordPress.' );
 574                                      if ( current_user_can( 'update_core' ) ) {
 575                                          printf(
 576                                              /* translators: %s: URL to WordPress Updates screen. */
 577                                              ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 578                                              self_admin_url( 'update-core.php' )
 579                                          );
 580                                      }
 581                                      ?>
 582                                  <# } else if ( ! data.compatible_php ) { #>
 583                                      <?php
 584                                      _e( 'This theme does not work with your version of PHP.' );
 585                                      if ( current_user_can( 'update_php' ) ) {
 586                                          printf(
 587                                              /* translators: %s: URL to Update PHP page. */
 588                                              ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 589                                              esc_url( wp_get_update_php_url() )
 590                                          );
 591                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 592                                      }
 593                                      ?>
 594                                  <# } #>
 595                              </p></div>
 596                          <# } #>
 597  
 598                          <div class="theme-description">{{{ data.description }}}</div>
 599                      </div>
 600                  </div>
 601              </div>
 602              <div class="wp-full-overlay-footer">
 603                  <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
 604                      <span class="collapse-sidebar-arrow" aria-hidden="true"></span>
 605                      <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
 606                  </button>
 607              </div>
 608          </div>
 609          <div class="wp-full-overlay-main">
 610          <iframe src="{{ data.preview_url }}" title="<?php echo esc_attr_x( 'Preview', 'noun' ); ?>"></iframe>
 611      </div>
 612  </script>
 613  
 614  <?php
 615  wp_print_request_filesystem_credentials_modal();
 616  wp_print_admin_notice_templates();
 617  
 618  require_once  ABSPATH . 'wp-admin/admin-footer.php';


Generated : Fri Jul 31 08:20:18 2026 Cross-referenced by PHPXref