wp/wp-includes/customize/class-wp-customize-themes-section.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    70 	 */
    70 	 */
    71 	protected function render_template() {
    71 	protected function render_template() {
    72 		?>
    72 		?>
    73 		<li id="accordion-section-{{ data.id }}" class="theme-section">
    73 		<li id="accordion-section-{{ data.id }}" class="theme-section">
    74 			<button type="button" class="customize-themes-section-title themes-section-{{ data.id }}">{{ data.title }}</button>
    74 			<button type="button" class="customize-themes-section-title themes-section-{{ data.id }}">{{ data.title }}</button>
    75 			<?php if ( current_user_can( 'install_themes' ) || is_multisite() ) : // @todo: upload support ?>
    75 			<?php if ( current_user_can( 'install_themes' ) || is_multisite() ) : // @todo Upload support. ?>
    76 			<?php endif; ?>
    76 			<?php endif; ?>
    77 			<div class="customize-themes-section themes-section-{{ data.id }} control-section-content themes-php">
    77 			<div class="customize-themes-section themes-section-{{ data.id }} control-section-content themes-php">
    78 				<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
    78 				<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
    79 				<div class="theme-browser rendered">
    79 				<div class="theme-browser rendered">
    80 					<div class="customize-preview-header themes-filter-bar">
    80 					<div class="customize-preview-header themes-filter-bar">
    81 						<?php $this->filter_bar_content_template(); ?>
    81 						<?php $this->filter_bar_content_template(); ?>
    82 					</div>
    82 					</div>
    83 					<?php $this->filter_drawer_content_template(); ?>
    83 					<?php $this->filter_drawer_content_template(); ?>
    84 					<div class="error unexpected-error" style="display: none; "><p><?php _e( '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="https://wordpress.org/support/">support forums</a>.' ); ?></p></div>
    84 					<div class="error unexpected-error" style="display: none; ">
       
    85 						<p>
       
    86 							<?php
       
    87 							printf(
       
    88 								/* translators: %s: Support forums URL. */
       
    89 								__( '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>.' ),
       
    90 								__( 'https://wordpress.org/support/forums/' )
       
    91 							);
       
    92 							?>
       
    93 						</p>
       
    94 					</div>
    85 					<ul class="themes">
    95 					<ul class="themes">
    86 					</ul>
    96 					</ul>
    87 					<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
    97 					<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
    88 					<p class="no-themes-local">
    98 					<p class="no-themes-local">
    89 						<?php
    99 						<?php
    90 						printf(
   100 						printf(
    91 							/* translators: %s: "Search WordPress.org themes" button text */
   101 							/* translators: %s: "Search WordPress.org themes" button text. */
    92 							__( 'No themes found. Try a different search, or %s.' ),
   102 							__( 'No themes found. Try a different search, or %s.' ),
    93 							sprintf( '<button type="button" class="button-link search-dotorg-themes">%s</button>', __( 'Search WordPress.org themes' ) )
   103 							sprintf( '<button type="button" class="button-link search-dotorg-themes">%s</button>', __( 'Search WordPress.org themes' ) )
    94 						);
   104 						);
    95 						?>
   105 						?>
    96 					</p>
   106 					</p>
   120 				<span id="{{ data.id }}-live-search-desc" class="screen-reader-text"><?php _e( 'The search results will be updated as you type.' ); ?></span>
   130 				<span id="{{ data.id }}-live-search-desc" class="screen-reader-text"><?php _e( 'The search results will be updated as you type.' ); ?></span>
   121 			</div>
   131 			</div>
   122 			<button type="button" class="button feature-filter-toggle">
   132 			<button type="button" class="button feature-filter-toggle">
   123 				<span class="filter-count-0"><?php _e( 'Filter themes' ); ?></span><span class="filter-count-filters">
   133 				<span class="filter-count-0"><?php _e( 'Filter themes' ); ?></span><span class="filter-count-filters">
   124 				<?php
   134 				<?php
   125 				/* translators: %s: number of filters selected. */
   135 				/* translators: %s: Number of filters selected. */
   126 				printf( __( 'Filter themes (%s)' ), '<span class="theme-filter-count">0</span>' );
   136 				printf( __( 'Filter themes (%s)' ), '<span class="theme-filter-count">0</span>' );
   127 				?>
   137 				?>
   128 				</span>
   138 				</span>
   129 			</button>
   139 			</button>
   130 		<# } else { #>
   140 		<# } else { #>
   136 			</div>
   146 			</div>
   137 		<# } #>
   147 		<# } #>
   138 		<div class="filter-themes-count">
   148 		<div class="filter-themes-count">
   139 			<span class="themes-displayed">
   149 			<span class="themes-displayed">
   140 				<?php
   150 				<?php
   141 				/* translators: %s: number of themes displayed. */
   151 				/* translators: %s: Number of themes displayed. */
   142 				echo sprintf( __( '%s themes' ), '<span class="theme-count">0</span>' );
   152 				printf( __( '%s themes' ), '<span class="theme-count">0</span>' );
   143 				?>
   153 				?>
   144 			</span>
   154 			</span>
   145 		</div>
   155 		</div>
   146 		<?php
   156 		<?php
   147 	}
   157 	}
   152 	 * The filter bar container is rendered by @see `render_template()`.
   162 	 * The filter bar container is rendered by @see `render_template()`.
   153 	 *
   163 	 *
   154 	 * @since 4.9.0
   164 	 * @since 4.9.0
   155 	 */
   165 	 */
   156 	protected function filter_drawer_content_template() {
   166 	protected function filter_drawer_content_template() {
   157 		$feature_list = get_theme_feature_list( false ); // @todo: Use the .org API instead of the local core feature list. The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned.
   167 		// @todo Use the .org API instead of the local core feature list.
       
   168 		// The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned.
       
   169 		$feature_list = get_theme_feature_list( false );
   158 		?>
   170 		?>
   159 		<# if ( 'wporg' === data.action ) { #>
   171 		<# if ( 'wporg' === data.action ) { #>
   160 			<div class="filter-drawer filter-details">
   172 			<div class="filter-drawer filter-details">
   161 				<?php foreach ( $feature_list as $feature_name => $features ) : ?>
   173 				<?php foreach ( $feature_list as $feature_name => $features ) : ?>
   162 					<fieldset class="filter-group">
   174 					<fieldset class="filter-group">