[ 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 $k => $v ) {
  39      if ( false !== strpos( $k, '/' ) ) {
  40          unset( $installed_themes[ $k ] );
  41      }
  42  }
  43  
  44  wp_localize_script(
  45      'theme',
  46      '_wpThemeSettings',
  47      array(
  48          'themes'          => false,
  49          'settings'        => array(
  50              'isInstall'  => true,
  51              'canInstall' => current_user_can( 'install_themes' ),
  52              'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
  53              'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH ),
  54          ),
  55          'l10n'            => array(
  56              'addNew'              => __( 'Add New Theme' ),
  57              'search'              => __( 'Search Themes' ),
  58              'searchPlaceholder'   => __( 'Search themes...' ), // Placeholder (no ellipsis).
  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              'collapseSidebar'     => __( 'Collapse Sidebar' ),
  71              'expandSidebar'       => __( 'Expand Sidebar' ),
  72              /* translators: Accessibility text. */
  73              'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
  74          ),
  75          'installedThemes' => array_keys( $installed_themes ),
  76          'activeTheme'     => get_stylesheet(),
  77      )
  78  );
  79  
  80  wp_enqueue_script( 'theme' );
  81  wp_enqueue_script( 'updates' );
  82  
  83  if ( $tab ) {
  84      /**
  85       * Fires before each of the tabs are rendered on the Install Themes page.
  86       *
  87       * The dynamic portion of the hook name, `$tab`, refers to the current
  88       * theme installation tab.
  89       *
  90       * Possible hook names include:
  91       *
  92       *  - `install_themes_pre_dashboard`
  93       *  - `install_themes_pre_featured`
  94       *  - `install_themes_pre_new`
  95       *  - `install_themes_pre_search`
  96       *  - `install_themes_pre_updated`
  97       *  - `install_themes_pre_upload`
  98       *
  99       * @since 2.8.0
 100       */
 101      do_action( "install_themes_pre_{$tab}" );
 102  }
 103  
 104  $help_overview =
 105      '<p>' . sprintf(
 106          /* translators: %s: Theme Directory URL. */
 107          __( '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.' ),
 108          __( 'https://wordpress.org/themes/' )
 109      ) . '</p>' .
 110      '<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>' .
 111      '<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>' .
 112      '<p>' . sprintf(
 113          /* translators: %s: /wp-content/themes */
 114          __( '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.' ),
 115          '<code>/wp-content/themes</code>'
 116      ) . '</p>';
 117  
 118  get_current_screen()->add_help_tab(
 119      array(
 120          'id'      => 'overview',
 121          'title'   => __( 'Overview' ),
 122          'content' => $help_overview,
 123      )
 124  );
 125  
 126  $help_installing =
 127      '<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&#8217;re 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>' .
 128      '<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>';
 129  
 130  get_current_screen()->add_help_tab(
 131      array(
 132          'id'      => 'installing',
 133          'title'   => __( 'Previewing and Installing' ),
 134          'content' => $help_installing,
 135      )
 136  );
 137  
 138  get_current_screen()->set_help_sidebar(
 139      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
 140      '<p>' . __( '<a href="https://wordpress.org/support/article/using-themes/#adding-new-themes">Documentation on Adding New Themes</a>' ) . '</p>' .
 141      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
 142  );
 143  
 144  require_once ABSPATH . 'wp-admin/admin-header.php';
 145  
 146  ?>
 147  <div class="wrap">
 148      <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
 149  
 150      <?php
 151  
 152      /**
 153       * Filters the tabs shown on the Add Themes screen.
 154       *
 155       * This filter is for backward compatibility only, for the suppression of the upload tab.
 156       *
 157       * @since 2.8.0
 158       *
 159       * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.
 160       */
 161      $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
 162      if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
 163          echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
 164      }
 165      ?>
 166  
 167      <hr class="wp-header-end">
 168  
 169      <div class="error hide-if-js">
 170          <p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>
 171      </div>
 172  
 173      <div class="upload-theme">
 174      <?php install_themes_upload(); ?>
 175      </div>
 176  
 177      <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2>
 178  
 179      <div class="wp-filter hide-if-no-js">
 180          <div class="filter-count">
 181              <span class="count theme-count"></span>
 182          </div>
 183  
 184          <ul class="filter-links">
 185              <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
 186              <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
 187              <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
 188          </ul>
 189  
 190          <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
 191  
 192          <form class="search-form"></form>
 193  
 194          <div class="favorites-form">
 195              <?php
 196              $action = 'save_wporg_username_' . get_current_user_id();
 197              if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
 198                  $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
 199                  update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
 200              } else {
 201                  $user = get_user_option( 'wporg_favorites' );
 202              }
 203              ?>
 204              <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
 205  
 206              <p>
 207                  <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
 208                  <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
 209                  <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
 210                  <input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
 211              </p>
 212          </div>
 213  
 214          <div class="filter-drawer">
 215              <div class="buttons">
 216                  <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
 217                  <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
 218              </div>
 219          <?php
 220          // Use the core list, rather than the .org API, due to inconsistencies
 221          // and to ensure tags are translated.
 222          $feature_list = get_theme_feature_list( false );
 223  
 224          foreach ( $feature_list as $feature_name => $features ) {
 225              echo '<fieldset class="filter-group">';
 226              $feature_name = esc_html( $feature_name );
 227              echo '<legend>' . $feature_name . '</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 . '">' . $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 }}" 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 doesn&#8217;t 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 doesn&#8217;t 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 doesn&#8217;t 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                              <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
 378                          <# } else { #>
 379                              <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
 380                          <# } #>
 381                      <# } else { #>
 382                          <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
 383                      <# } #>
 384                  <# } else { #>
 385                      <?php
 386                      /* translators: %s: Theme name. */
 387                      $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
 388                      ?>
 389                      <# if ( data.activate_url ) { #>
 390                          <a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
 391                      <# } #>
 392                      <# if ( data.customize_url ) { #>
 393                          <a class="button disabled"><?php _e( 'Live Preview' ); ?></a>
 394                      <# } else { #>
 395                          <button class="button disabled"><?php _e( 'Preview' ); ?></button>
 396                      <# } #>
 397                  <# } #>
 398              <# } else { #>
 399                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 400                      <?php
 401                      /* translators: %s: Theme name. */
 402                      $aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
 403                      ?>
 404                      <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>
 405                      <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
 406                  <# } else { #>
 407                      <?php
 408                      /* translators: %s: Theme name. */
 409                      $aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
 410                      ?>
 411                      <a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
 412                      <button class="button disabled"><?php _e( 'Preview' ); ?></button>
 413                  <# } #>
 414              <# } #>
 415          </div>
 416      </div>
 417  </script>
 418  
 419  <script id="tmpl-theme-preview" type="text/template">
 420      <div class="wp-full-overlay-sidebar">
 421          <div class="wp-full-overlay-header">
 422              <button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
 423              <button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button>
 424              <button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button>
 425              <# if ( data.installed ) { #>
 426                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 427                      <?php
 428                      /* translators: %s: Theme name. */
 429                      $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 430                      ?>
 431                      <# if ( ! data.active ) { #>
 432                          <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
 433                      <# } else { #>
 434                          <button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
 435                      <# } #>
 436                  <# } else { #>
 437                      <a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
 438                  <# } #>
 439              <# } else { #>
 440                  <# if ( data.compatible_wp && data.compatible_php ) { #>
 441                      <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
 442                  <# } else { #>
 443                      <a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
 444                  <# } #>
 445              <# } #>
 446          </div>
 447          <div class="wp-full-overlay-sidebar-content">
 448              <div class="install-theme-info">
 449                  <h3 class="theme-name">{{ data.name }}</h3>
 450                      <span class="theme-by">
 451                          <?php
 452                          /* translators: %s: Theme author name. */
 453                          printf( __( 'By %s' ), '{{ data.author }}' );
 454                          ?>
 455                      </span>
 456  
 457                      <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
 458  
 459                      <div class="theme-details">
 460                          <# if ( data.rating ) { #>
 461                              <div class="theme-rating">
 462                                  {{{ data.stars }}}
 463                                  <a class="num-ratings" href="{{ data.reviews_url }}">
 464                                      <?php
 465                                      /* translators: %s: Number of ratings. */
 466                                      printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
 467                                      ?>
 468                                  </a>
 469                              </div>
 470                          <# } else { #>
 471                              <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
 472                          <# } #>
 473  
 474                          <div class="theme-version">
 475                              <?php
 476                              /* translators: %s: Theme version. */
 477                              printf( __( 'Version: %s' ), '{{ data.version }}' );
 478                              ?>
 479                          </div>
 480  
 481                          <# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
 482                              <div class="notice notice-error notice-alt notice-large"><p>
 483                                  <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
 484                                      <?php
 485                                      _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
 486                                      if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
 487                                          printf(
 488                                              /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
 489                                              ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
 490                                              self_admin_url( 'update-core.php' ),
 491                                              esc_url( wp_get_update_php_url() )
 492                                          );
 493                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 494                                      } elseif ( current_user_can( 'update_core' ) ) {
 495                                          printf(
 496                                              /* translators: %s: URL to WordPress Updates screen. */
 497                                              ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 498                                              self_admin_url( 'update-core.php' )
 499                                          );
 500                                      } elseif ( current_user_can( 'update_php' ) ) {
 501                                          printf(
 502                                              /* translators: %s: URL to Update PHP page. */
 503                                              ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 504                                              esc_url( wp_get_update_php_url() )
 505                                          );
 506                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 507                                      }
 508                                      ?>
 509                                  <# } else if ( ! data.compatible_wp ) { #>
 510                                      <?php
 511                                      _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
 512                                      if ( current_user_can( 'update_core' ) ) {
 513                                          printf(
 514                                              /* translators: %s: URL to WordPress Updates screen. */
 515                                              ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
 516                                              self_admin_url( 'update-core.php' )
 517                                          );
 518                                      }
 519                                      ?>
 520                                  <# } else if ( ! data.compatible_php ) { #>
 521                                      <?php
 522                                      _e( 'This theme doesn&#8217;t work with your version of PHP.' );
 523                                      if ( current_user_can( 'update_php' ) ) {
 524                                          printf(
 525                                              /* translators: %s: URL to Update PHP page. */
 526                                              ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
 527                                              esc_url( wp_get_update_php_url() )
 528                                          );
 529                                          wp_update_php_annotation( '</p><p><em>', '</em>' );
 530                                      }
 531                                      ?>
 532                                  <# } #>
 533                              </p></div>
 534                          <# } #>
 535  
 536                          <div class="theme-description">{{{ data.description }}}</div>
 537                      </div>
 538                  </div>
 539              </div>
 540              <div class="wp-full-overlay-footer">
 541                  <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
 542                      <span class="collapse-sidebar-arrow"></span>
 543                      <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
 544                  </button>
 545              </div>
 546          </div>
 547          <div class="wp-full-overlay-main">
 548          <iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
 549      </div>
 550  </script>
 551  
 552  <?php
 553  wp_print_request_filesystem_credentials_modal();
 554  wp_print_admin_notice_templates();
 555  
 556  require_once ABSPATH . 'wp-admin/admin-footer.php';


Generated: Thu Sep 23 01:00:04 2021 Cross-referenced by PHPXref 0.7.1