[ Index ]

PHP Cross Reference of WordPress

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  wp_reset_vars( array( '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 New Theme' ),
  58              'search'              => __( 'Search Themes' ),
  59              'searchPlaceholder'   => __( 'Search themes...' ), // Placeholder (no ellipsis).
  60              'upload'              => __( 'Upload Theme' ),
  61              'back'                => __( 'Back' ),
  62              'error'               => sprintf(
  63                  /* translators: %s: Support forums URL. */
  64                  __( '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>.' ),
  65                  __( 'https://wordpress.org/support/forums/' )
  66              ),
  67              'tryAgain'            => __( 'Try Again' ),
  68              /* translators: %d: Number of themes. */
  69              'themesFound'         => __( 'Number of Themes found: %d' ),
  70              'noThemesFound'       => __( 'No themes found. Try a different search.' ),
  71              'collapseSidebar'     => __( 'Collapse Sidebar' ),
  72              'expandSidebar'       => __( 'Expand Sidebar' ),
  73              /* translators: Accessibility text. */
  74              'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
  75          ),
  76          'installedThemes' => array_keys( $installed_themes ),
  77          'activeTheme'     => get_stylesheet(),
  78      )
  79  );
  80  
  81  wp_enqueue_script( 'theme' );
  82  wp_enqueue_script( 'updates' );
  83  
  84  if ( $tab ) {
  85      /**
  86       * Fires before each of the tabs are rendered on the Install Themes page.
  87       *
  88       * The dynamic portion of the hook name, `$tab`, refers to the current
  89       * theme installation tab.
  90       *
  91       * Possible hook names include:
  92       *
  93       *  - `install_themes_pre_dashboard`
  94       *  - `install_themes_pre_featured`
  95       *  - `install_themes_pre_new`
  96       *  - `install_themes_pre_search`
  97       *  - `install_themes_pre_updated`
  98       *  - `install_themes_pre_upload`
  99       *
 100       * @since 2.8.0
 101       */
 102      do_action( "install_themes_pre_{$tab}" );
 103  }
 104  
 105  $help_overview =
 106      '<p>' . sprintf(
 107          /* translators: %s: Theme Directory URL. */
 108          __( '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.' ),
 109          __( 'https://wordpress.org/themes/' )
 110      ) . '</p>' .
 111      '<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>' .
 112      '<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>' .
 113      '<p>' . sprintf(
 114          /* translators: %s: /wp-content/themes */
 115          __( '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.' ),
 116          '<code>/wp-content/themes</code>'
 117      ) . '</p>';
 118  
 119  get_current_screen()->add_help_tab(
 120      array(
 121          'id'      => 'overview',
 122          'title'   => __( 'Overview' ),
 123          'content' => $help_overview,
 124      )
 125  );
 126  
 127  $help_installing =
 128      '<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>' .
 129      '<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>';
 130  
 131  get_current_screen()->add_help_tab(
 132      array(
 133          'id'      => 'installing',
 134          'title'   => __( 'Previewing and Installing' ),
 135          'content' => $help_installing,
 136      )
 137  );
 138  
 139  get_current_screen()->set_help_sidebar(
 140      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
 141      '<p>' . __( '<a href="https://wordpress.org/support/article/appearance-themes-screen/#install-themes">Documentation on Adding New Themes</a>' ) . '</p>' .
 142      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
 143  );
 144  
 145  require_once ABSPATH . 'wp-admin/admin-header.php';
 146  
 147  ?>
 148  <div class="wrap">
 149      <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
 150  
 151      <?php
 152  
 153      /**
 154       * Filters the tabs shown on the Add Themes screen.
 155       *
 156       * This filter is for backward compatibility only, for the suppression of the upload tab.
 157       *
 158       * @since 2.8.0
 159       *
 160       * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.
 161       */
 162      $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
 163      if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
 164          echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
 165      }
 166      ?>
 167  
 168      <hr class="wp-header-end">
 169  
 170      <div class="error hide-if-js">
 171          <p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>
 172      </div>
 173  
 174      <div class="upload-theme">
 175      <?php install_themes_upload(); ?>
 176      </div>
 177  
 178      <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2>
 179  
 180      <div class="wp-filter hide-if-no-js">
 181          <div class="filter-count">
 182              <span class="count theme-count"></span>
 183          </div>
 184  
 185          <ul class="filter-links">
 186              <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
 187              <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
 188              <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
 189          </ul>
 190  
 191          <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
 192  
 193          <form class="search-form"></form>
 194  
 195          <div class="favorites-form">
 196              <?php
 197              $action = 'save_wporg_username_' . get_current_user_id();
 198              if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
 199                  $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
 200                  update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
 201              } else {
 202                  $user = get_user_option( 'wporg_favorites' );
 203              }
 204              ?>
 205              <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
 206  
 207              <p>
 208                  <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
 209                  <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
 210                  <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
 211                  <input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
 212              </p>
 213          </div>
 214  
 215          <div class="filter-drawer">
 216              <div class="buttons">
 217                  <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
 218                  <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
 219              </div>
 220          <?php
 221          // Use the core list, rather than the .org API, due to inconsistencies
 222          // and to ensure tags are translated.
 223          $feature_list = get_theme_feature_list( false );
 224  
 225          foreach ( $feature_list as $feature_group => $features ) {
 226              echo '<fieldset class="filter-group">';
 227              echo '<legend>' . esc_html( $feature_group ) . '</legend>';
 228              echo '<div class="filter-group-feature">';
 229              foreach ( $features as $feature => $feature_name ) {
 230                  $feature = esc_attr( $feature );
 231                  echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
 232                  echo '<label for="filter-id-' . $feature . '">' . esc_html( $feature_name ) . '</label>';
 233              }
 234              echo '</div>';
 235              echo '</fieldset>';
 236          }
 237          ?>
 238              <div class="buttons">
 239                  <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
 240                  <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
 241              </div>
 242              <div class="filtered-by">
 243                  <span><?php _e( 'Filtering by:' ); ?></span>
 244                  <div class="tags"></div>
 245                  <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
 246              </div>
 247          </div>
 248      </div>
 249      <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Themes list' ); ?></h2>
 250      <div class="theme-browser content-filterable"></div>
 251      <div class="theme-install-overlay wp-full-overlay expanded"></div>
 252  
 253      <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
 254      <span class="spinner"></span>
 255  
 256  <?php
 257  if ( $tab ) {
 258      /**
 259       * Fires at the top of each of the tabs on the Install Themes page.
 260       *
 261       * The dynamic portion of the hook name, `$tab`, refers to the current
 262       * theme installation tab.
 263       *
 264       * Possible hook names include:
 265       *
 266       *  - `install_themes_dashboard`
 267       *  - `install_themes_featured`
 268       *  - `install_themes_new`
 269       *  - `install_themes_search`
 270       *  - `install_themes_updated`
 271       *  - `install_themes_upload`
 272       *
 273       * @since 2.8.0
 274       *
 275       * @param int $paged Number of the current page of results being viewed.
 276       */
 277      do_action( "install_themes_{$tab}", $paged );
 278  }
 279  ?>
 280  </div>
 281  
 282  <script id="tmpl-theme" type="text/template">
 283      <# if ( data.screenshot_url ) { #>
 284          <div class="theme-screenshot">
 285              <img src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
 286          </div>
 287      <# } else { #>
 288          <div class="theme-screenshot blank"></div>
 289      <# } #>
 290  
 291      <# if ( data.installed ) { #>
 292          <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
 293      <# } #>
 294  
 295      <# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
 296          <div class="notice notice-error notice-alt"><p>
 297              <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
 298                  <?php
 299                  _e( 'This theme does not work with your versions of WordPress and PHP.' );
 300                  if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
 301                      printf(
 302                          /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
 303                          ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
 304                          self_admin_url( 'update-core.php' ),
 305                          esc_url( wp_get_update_php_url() )
 306                      );
 307                      wp_update_php_annotation( '</p><p><em>', '</em>' );
 308                  } elseif ( current_user_can( 'update_core' ) ) {
 309                      printf(
 310                          /* translators: %s: URL to WordPress Updates screen. */
 311                          ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 312                          self_admin_url( 'update-core.php' )
 313                      );
 314                  } elseif ( current_user_can( 'update_php' ) ) {
 315                      printf(
 316                          /* translators: %s: URL to Update PHP page. */
 317                          ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 318                          esc_url( wp_get_update_php_url() )
 319                      );
 320                      wp_update_php_annotation( '</p><p><em>', '</em>' );
 321                  }
 322                  ?>
 323              <# } else if ( ! data.compatible_wp ) { #>
 324                  <?php
 325                  _e( 'This theme does not work with your version of WordPress.' );
 326                  if ( current_user_can( 'update_core' ) ) {
 327                      printf(
 328                          /* translators: %s: URL to WordPress Updates screen. */
 329                          ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 330                          self_admin_url( 'update-core.php' )
 331                      );
 332                  }
 333                  ?>
 334              <# } else if ( ! data.compatible_php ) { #>
 335                  <?php
 336                  _e( 'This theme does not work with your version of PHP.' );
 337                  if ( current_user_can( 'update_php' ) ) {
 338                      printf(
 339                          /* translators: %s: URL to Update PHP page. */
 340                          ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 341                          esc_url( wp_get_update_php_url() )
 342                      );
 343                      wp_update_php_annotation( '</p><p><em>', '</em>' );
 344                  }
 345                  ?>
 346              <# } #>
 347          </p></div>
 348      <# } #>
 349  
 350      <span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
 351      <div class="theme-author">
 352          <?php
 353          /* translators: %s: Theme author name. */
 354          printf( __( 'By %s' ), '{{ data.author }}' );
 355          ?>
 356      </div>
 357  
 358      <div class="theme-id-container">
 359          <h3 class="theme-name">{{ data.name }}</h3>
 360  
 361          <div class="theme-actions">
 362              <# if ( data.installed ) { #>
 363                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 364                      <?php
 365                      /* translators: %s: Theme name. */
 366                      $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 367                      ?>
 368                      <# if ( data.activate_url ) { #>
 369                          <# if ( ! data.active ) { #>
 370                              <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
 371                          <# } else { #>
 372                              <button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
 373                          <# } #>
 374                      <# } #>
 375                      <# if ( data.customize_url ) { #>
 376                          <# if ( ! data.active ) { #>
 377                              <# if ( ! data.block_theme ) { #>
 378                                  <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
 379                              <# } #>
 380                          <# } else { #>
 381                              <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
 382                          <# } #>
 383                      <# } else { #>
 384                          <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
 385                      <# } #>
 386                  <# } else { #>
 387                      <?php
 388                      /* translators: %s: Theme name. */
 389                      $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
 390                      ?>
 391                      <# if ( data.activate_url ) { #>
 392                          <a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
 393                      <# } #>
 394                      <# if ( data.customize_url ) { #>
 395                          <a class="button disabled"><?php _e( 'Live Preview' ); ?></a>
 396                      <# } else { #>
 397                          <button class="button disabled"><?php _e( 'Preview' ); ?></button>
 398                      <# } #>
 399                  <# } #>
 400              <# } else { #>
 401                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 402                      <?php
 403                      /* translators: %s: Theme name. */
 404                      $aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
 405                      ?>
 406                      <a class="button button-primary 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>
 407                      <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
 408                  <# } else { #>
 409                      <?php
 410                      /* translators: %s: Theme name. */
 411                      $aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
 412                      ?>
 413                      <a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
 414                      <button class="button disabled"><?php _e( 'Preview' ); ?></button>
 415                  <# } #>
 416              <# } #>
 417          </div>
 418      </div>
 419  </script>
 420  
 421  <script id="tmpl-theme-preview" type="text/template">
 422      <div class="wp-full-overlay-sidebar">
 423          <div class="wp-full-overlay-header">
 424              <button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
 425              <button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button>
 426              <button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button>
 427              <# if ( data.installed ) { #>
 428                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 429                      <?php
 430                      /* translators: %s: Theme name. */
 431                      $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 432                      ?>
 433                      <# if ( ! data.active ) { #>
 434                          <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
 435                      <# } else { #>
 436                          <button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
 437                      <# } #>
 438                  <# } else { #>
 439                      <a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
 440                  <# } #>
 441              <# } else { #>
 442                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 443                      <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
 444                  <# } else { #>
 445                      <a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
 446                  <# } #>
 447              <# } #>
 448          </div>
 449          <div class="wp-full-overlay-sidebar-content">
 450              <div class="install-theme-info">
 451                  <h3 class="theme-name">{{ data.name }}</h3>
 452                      <span class="theme-by">
 453                          <?php
 454                          /* translators: %s: Theme author name. */
 455                          printf( __( 'By %s' ), '{{ data.author }}' );
 456                          ?>
 457                      </span>
 458  
 459                      <div class="theme-screenshot">
 460                          <img class="theme-screenshot" src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
 461                      </div>
 462  
 463                      <div class="theme-details">
 464                          <# if ( data.rating ) { #>
 465                              <div class="theme-rating">
 466                                  {{{ data.stars }}}
 467                                  <a class="num-ratings" href="{{ data.reviews_url }}">
 468                                      <?php
 469                                      /* translators: %s: Number of ratings. */
 470                                      printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
 471                                      ?>
 472                                  </a>
 473                              </div>
 474                          <# } else { #>
 475                              <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
 476                          <# } #>
 477  
 478                          <div class="theme-version">
 479                              <?php
 480                              /* translators: %s: Theme version. */
 481                              printf( __( 'Version: %s' ), '{{ data.version }}' );
 482                              ?>
 483                          </div>
 484  
 485                          <# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
 486                              <div class="notice notice-error notice-alt notice-large"><p>
 487                                  <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
 488                                      <?php
 489                                      _e( 'This theme does not work with your versions of WordPress and PHP.' );
 490                                      if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
 491                                          printf(
 492                                              /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
 493                                              ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
 494                                              self_admin_url( 'update-core.php' ),
 495                                              esc_url( wp_get_update_php_url() )
 496                                          );
 497                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 498                                      } elseif ( current_user_can( 'update_core' ) ) {
 499                                          printf(
 500                                              /* translators: %s: URL to WordPress Updates screen. */
 501                                              ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 502                                              self_admin_url( 'update-core.php' )
 503                                          );
 504                                      } elseif ( current_user_can( 'update_php' ) ) {
 505                                          printf(
 506                                              /* translators: %s: URL to Update PHP page. */
 507                                              ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 508                                              esc_url( wp_get_update_php_url() )
 509                                          );
 510                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 511                                      }
 512                                      ?>
 513                                  <# } else if ( ! data.compatible_wp ) { #>
 514                                      <?php
 515                                      _e( 'This theme does not work with your version of WordPress.' );
 516                                      if ( current_user_can( 'update_core' ) ) {
 517                                          printf(
 518                                              /* translators: %s: URL to WordPress Updates screen. */
 519                                              ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 520                                              self_admin_url( 'update-core.php' )
 521                                          );
 522                                      }
 523                                      ?>
 524                                  <# } else if ( ! data.compatible_php ) { #>
 525                                      <?php
 526                                      _e( 'This theme does not work with your version of PHP.' );
 527                                      if ( current_user_can( 'update_php' ) ) {
 528                                          printf(
 529                                              /* translators: %s: URL to Update PHP page. */
 530                                              ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 531                                              esc_url( wp_get_update_php_url() )
 532                                          );
 533                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 534                                      }
 535                                      ?>
 536                                  <# } #>
 537                              </p></div>
 538                          <# } #>
 539  
 540                          <div class="theme-description">{{{ data.description }}}</div>
 541                      </div>
 542                  </div>
 543              </div>
 544              <div class="wp-full-overlay-footer">
 545                  <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
 546                      <span class="collapse-sidebar-arrow"></span>
 547                      <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
 548                  </button>
 549              </div>
 550          </div>
 551          <div class="wp-full-overlay-main">
 552          <iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
 553      </div>
 554  </script>
 555  
 556  <?php
 557  wp_print_request_filesystem_credentials_modal();
 558  wp_print_admin_notice_templates();
 559  
 560  require_once ABSPATH . 'wp-admin/admin-footer.php';


Generated: Sat Apr 27 01:00:02 2024 Cross-referenced by PHPXref 0.7.1