Imprime les modèles JS pour l'interface utilisateur de navigation par thème dans le Customizer.

Source

Fichier : wp-admin/includes/theme.php

function customize_themes_print_templates() {
	?>
	<scripttype="text/html"id="tmpl-customize-themes-details-view"><div class="theme-backdrop"></div><div class="theme-wrap wp-clearfix" role="document"><div class="theme-header"><button type="button"class="left dashicons dashicons-no"><span class="screen-reader-text">_e('Show previous theme');?></span></button><button type="button"class="right dashicons dashicons-no"><span class="screen-reader-text">_e('Show next theme');?></span></button><button type="button"class="close dashicons dashicons-no"><span class="screen-reader-text">_e('Close details dialog');?></span></button></div><div class="theme-about wp-clearfix"><div class="theme-screenshots"><# if( datascreenshot && datascreenshot[0]){ #><div class="screenshot"><img src="{{ data.screenshot[0] }}" alt=""/></div><# }else{ #><div class="screenshot blank"></div><# } #></div><div class="theme-info"><# if( dataactive ){ #><span class="current-label">_e('Current Theme');?></span><# } #><h2 class="theme-name">{{{ dataname }}}<span class="theme-version">/* translators: %s: Theme version. */printf(__('Version: %s'),'{{ data.version }}');?></span></h2><h3 class="theme-author">/* translators: %s: Theme author link. */printf(__('By %s'),'{{{ data.authorAndUri }}}');?></h3><# if( datastars &&0!= datanum_ratings ){ #><div class="theme-rating">{{{ datastars }}}<a class="num-ratings" target="_blank" href="{{ data.reviews_url }}">printf('%1$s %2$s',/* translators: %s: Number of ratings. */sprintf(__('(%s ratings)'),'{{ data.num_ratings }}'),/* translators: Accessibility text. */__('(opens in a new tab)'));?></a></div><# } #><# if( datahasUpdate ){ #><# if( dataupdateResponsecompatibleWP && dataupdateResponsecompatiblePHP ){ #><div class="notice notice-warning notice-alt notice-large" data-slug="{{ data.id }}"><h3 class="notice-title">_e('Update Available');?></h3>{{{ dataupdate }}}</div><# }else{ #><div class="notice notice-error notice-alt notice-large" data-slug="{{ data.id }}"><h3 class="notice-title">_e('Update Incompatible');?></h3><p><# if(! dataupdateResponsecompatibleWP &&! dataupdateResponsecompatiblePHP ){ #>printf(/* translators: %s: Theme name. */__('There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.'),'{{{ data.name }}}');if(current_user_can('update_core')&&current_user_can('update_php')){printf(/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */' '__('Please update WordPress, and then learn more about updating PHP.'),self_admin_url('update-core.php'),esc_url(wp_get_update_php_url()));wp_update_php_annotation('

','');}elseif(current_user_can('update_core')){printf(/* translators: %s: URL to WordPress Updates screen. */' '__('Please update WordPress.'),self_admin_url('update-core.php'));}elseif(current_user_can('update_php')){printf(/* translators: %s: URL to Update PHP page. */' '__('Learn more about updating PHP.'),esc_url(wp_get_update_php_url()));wp_update_php_annotation('

','');}?><# }elseif(! dataupdateResponsecompatibleWP ){ #>printf(/* translators: %s: Theme name. */__('There is a new version of %s available, but it doesn’t work with your version of WordPress.'),'{{{ data.name }}}');if(current_user_can('update_core')){printf(/* translators: %s: URL to WordPress Updates screen. */' '__('Please update WordPress.'),self_admin_url('update-core.php'));}?><# }elseif(! dataupdateResponsecompatiblePHP ){ #>printf(/* translators: %s: Theme name. */__('There is a new version of %s available, but it doesn’t work with your version of PHP.'),'{{{ data.name }}}');if(current_user_can('update_php')){printf(/* translators: %s: URL to Update PHP page. */' '__('Learn more about updating PHP.'),esc_url(wp_get_update_php_url()));wp_update_php_annotation('

','');}?><# } #></p></div><# } #><# } #><# if( dataparent ){ #><p class="parent-theme">printf(/* translators: %s: Theme name. */__('This is a child theme of %s.'),'{{{ data.parent }}}');?></p><# } #><# if(! datacompatibleWP ||! datacompatiblePHP ){ #><div class="notice notice-error notice-alt notice-large"><p><# if(! datacompatibleWP &&! datacompatiblePHP ){ #>_e('This theme doesn’t work with your versions of WordPress and PHP.');if(current_user_can('update_core')&&current_user_can('update_php')){printf(/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */' '__('Please update WordPress, and then learn more about updating PHP.'),self_admin_url('update-core.php'),esc_url(wp_get_update_php_url()));wp_update_php_annotation('

','');}elseif(current_user_can('update_core')){printf(/* translators: %s: URL to WordPress Updates screen. */' '__('Please update WordPress.'),self_admin_url('update-core.php'));}elseif(current_user_can('update_php')){printf(/* translators: %s: URL to Update PHP page. */' '__('Learn more about updating PHP.'),esc_url(wp_get_update_php_url()));wp_update_php_annotation('

','');}?><# }elseif(! datacompatibleWP ){ #>_e('This theme doesn’t work with your version of WordPress.');if(current_user_can('update_core')){printf(/* translators: %s: URL to WordPress Updates screen. */' '__('Please update WordPress.'),self_admin_url('update-core.php'));}?><# }elseif(! datacompatiblePHP ){ #>_e('This theme doesn’t work with your version of PHP.');if(current_user_can('update_php')){printf(/* translators: %s: URL to Update PHP page. */' '__('Learn more about updating PHP.'),esc_url(wp_get_update_php_url()));wp_update_php_annotation('

','');}?><# } #></p></div><# } #><p class="theme-description">{{{ datadescription }}}</p><# if( datatags ){ #><p class="theme-tags"><span>_e('Tags:');?></span>{{{ datatags }}}</p><# } #></div></div><div class="theme-actions"><# if( dataactive ){ #><button type="button"class="button button-primary customize-theme">_e('Customize');?></button><# }elseif('installed'=== datatype ){ #>if(current_user_can('delete_themes')){?><# if( dataactions && dataactions['delete']){ #><a href="{{{ data.actions['delete'] }}}" data-slug="{{ data.id }}"class="button button-secondary delete-theme">_e('Delete');?></a><# } #>}?><# if( datacompatibleWP && datacompatiblePHP ){ #><button type="button"class="button button-primary preview-theme" data-slug="{{ data.id }}">_e('Live Preview');?></button><# }else{ #><button class="button button-primary disabled">_e('Live Preview');?></button><# } #><# }else{ #><# if( datacompatibleWP && datacompatiblePHP ){ #><button type="button"class="button theme-install" data-slug="{{ data.id }}">_e('Install');?></button><button type="button"class="button button-primary theme-install preview" data-slug="{{ data.id }}">_e('Install & Preview');?></button><# }else{ #><button type="button"class="button disabled">_ex('Cannot Install','theme');?></button><button type="button"class="button button-primary disabled">_e('Install & Preview');?></button><# } #><# } #></div></div>script>}

Related

Utilise

Utilisations Description
wp-includes/functions.php : wp_get_update_php_url()

Récupère la URL pour en savoir plus sur la mise à jour de la version PHP sur laquelle tourne le site.

wp-includes/functions.php : wp_update_php_annotation()

Imprime l'annotation par défaut de l'hôte web modifiant l'URL de la page "Update PHP".

wp-includes/capabilities.php : current_user_can()

Renvoie si l'utilisateur actuel a la capacité spécifiée.

wp-includes/l10n.php : _e()

Affichage du texte traduit.

wp-includes/l10n.php : __()

Récupérer la traduction de $text.

wp-includes/l10n.php : _ex()

Affichage de la chaîne traduite avec le contexte gettext.

wp-includes/formatting.php : esc_url()

Vérifie et nettoie une URL.

wp-includes/link-template.php : self_admin_url()

Récupère l'URL de la zone d'administration pour le site actuel ou le réseau selon le contexte.

Changelog

Version Description
4.2.0 Introduit.