Edit File by line
/home/barbar84/www/wp-admin
File: themes.php
_e( 'This theme doesn’t work with your version of PHP.' );
[500] Fix | Delete
if ( current_user_can( 'update_php' ) ) {
[501] Fix | Delete
printf(
[502] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[503] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[504] Fix | Delete
esc_url( wp_get_update_php_url() )
[505] Fix | Delete
);
[506] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[507] Fix | Delete
}
[508] Fix | Delete
}
[509] Fix | Delete
echo '</p></div>';
[510] Fix | Delete
}
[511] Fix | Delete
?>
[512] Fix | Delete
[513] Fix | Delete
<span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
[514] Fix | Delete
<div class="theme-author">
[515] Fix | Delete
<?php
[516] Fix | Delete
/* translators: %s: Theme author name. */
[517] Fix | Delete
printf( __( 'By %s' ), $theme['author'] );
[518] Fix | Delete
?>
[519] Fix | Delete
</div>
[520] Fix | Delete
[521] Fix | Delete
<div class="theme-id-container">
[522] Fix | Delete
<?php if ( $theme['active'] ) { ?>
[523] Fix | Delete
<h2 class="theme-name" id="<?php echo $aria_name; ?>">
[524] Fix | Delete
<span><?php _ex( 'Active:', 'theme' ); ?></span> <?php echo $theme['name']; ?>
[525] Fix | Delete
</h2>
[526] Fix | Delete
<?php } else { ?>
[527] Fix | Delete
<h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $theme['name']; ?></h2>
[528] Fix | Delete
<?php } ?>
[529] Fix | Delete
[530] Fix | Delete
<div class="theme-actions">
[531] Fix | Delete
<?php if ( $theme['active'] ) { ?>
[532] Fix | Delete
<?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
[533] Fix | Delete
<a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
[534] Fix | Delete
<?php } ?>
[535] Fix | Delete
<?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?>
[536] Fix | Delete
<?php
[537] Fix | Delete
/* translators: %s: Theme name. */
[538] Fix | Delete
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
[539] Fix | Delete
?>
[540] Fix | Delete
<a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
[541] Fix | Delete
<?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
[542] Fix | Delete
<a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
[543] Fix | Delete
<?php } ?>
[544] Fix | Delete
<?php } else { ?>
[545] Fix | Delete
<?php
[546] Fix | Delete
/* translators: %s: Theme name. */
[547] Fix | Delete
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
[548] Fix | Delete
?>
[549] Fix | Delete
<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
[550] Fix | Delete
<?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
[551] Fix | Delete
<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
[552] Fix | Delete
<?php } ?>
[553] Fix | Delete
<?php } ?>
[554] Fix | Delete
[555] Fix | Delete
</div>
[556] Fix | Delete
</div>
[557] Fix | Delete
</div>
[558] Fix | Delete
<?php endforeach; ?>
[559] Fix | Delete
</div>
[560] Fix | Delete
</div>
[561] Fix | Delete
<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
[562] Fix | Delete
[563] Fix | Delete
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
[564] Fix | Delete
[565] Fix | Delete
<?php
[566] Fix | Delete
// List broken themes, if any.
[567] Fix | Delete
$broken_themes = wp_get_themes( array( 'errors' => true ) );
[568] Fix | Delete
if ( ! is_multisite() && $broken_themes ) {
[569] Fix | Delete
?>
[570] Fix | Delete
[571] Fix | Delete
<div class="broken-themes">
[572] Fix | Delete
<h3><?php _e( 'Broken Themes' ); ?></h3>
[573] Fix | Delete
<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
[574] Fix | Delete
[575] Fix | Delete
<?php
[576] Fix | Delete
$can_resume = current_user_can( 'resume_themes' );
[577] Fix | Delete
$can_delete = current_user_can( 'delete_themes' );
[578] Fix | Delete
$can_install = current_user_can( 'install_themes' );
[579] Fix | Delete
?>
[580] Fix | Delete
<table>
[581] Fix | Delete
<tr>
[582] Fix | Delete
<th><?php _ex( 'Name', 'theme name' ); ?></th>
[583] Fix | Delete
<th><?php _e( 'Description' ); ?></th>
[584] Fix | Delete
<?php if ( $can_resume ) { ?>
[585] Fix | Delete
<td></td>
[586] Fix | Delete
<?php } ?>
[587] Fix | Delete
<?php if ( $can_delete ) { ?>
[588] Fix | Delete
<td></td>
[589] Fix | Delete
<?php } ?>
[590] Fix | Delete
<?php if ( $can_install ) { ?>
[591] Fix | Delete
<td></td>
[592] Fix | Delete
<?php } ?>
[593] Fix | Delete
</tr>
[594] Fix | Delete
<?php foreach ( $broken_themes as $broken_theme ) : ?>
[595] Fix | Delete
<tr>
[596] Fix | Delete
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?></td>
[597] Fix | Delete
<td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
[598] Fix | Delete
<?php
[599] Fix | Delete
if ( $can_resume ) {
[600] Fix | Delete
if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) {
[601] Fix | Delete
$stylesheet = $broken_theme->get_stylesheet();
[602] Fix | Delete
$resume_url = add_query_arg(
[603] Fix | Delete
array(
[604] Fix | Delete
'action' => 'resume',
[605] Fix | Delete
'stylesheet' => urlencode( $stylesheet ),
[606] Fix | Delete
),
[607] Fix | Delete
admin_url( 'themes.php' )
[608] Fix | Delete
);
[609] Fix | Delete
$resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet );
[610] Fix | Delete
?>
[611] Fix | Delete
<td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td>
[612] Fix | Delete
<?php
[613] Fix | Delete
} else {
[614] Fix | Delete
?>
[615] Fix | Delete
<td></td>
[616] Fix | Delete
<?php
[617] Fix | Delete
}
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
if ( $can_delete ) {
[621] Fix | Delete
$stylesheet = $broken_theme->get_stylesheet();
[622] Fix | Delete
$delete_url = add_query_arg(
[623] Fix | Delete
array(
[624] Fix | Delete
'action' => 'delete',
[625] Fix | Delete
'stylesheet' => urlencode( $stylesheet ),
[626] Fix | Delete
),
[627] Fix | Delete
admin_url( 'themes.php' )
[628] Fix | Delete
);
[629] Fix | Delete
$delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
[630] Fix | Delete
?>
[631] Fix | Delete
<td><a href="<?php echo esc_url( $delete_url ); ?>" class="button delete-theme"><?php _e( 'Delete' ); ?></a></td>
[632] Fix | Delete
<?php
[633] Fix | Delete
}
[634] Fix | Delete
[635] Fix | Delete
if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) {
[636] Fix | Delete
$parent_theme_name = $broken_theme->get( 'Template' );
[637] Fix | Delete
$parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) );
[638] Fix | Delete
[639] Fix | Delete
if ( ! is_wp_error( $parent_theme ) ) {
[640] Fix | Delete
$install_url = add_query_arg(
[641] Fix | Delete
array(
[642] Fix | Delete
'action' => 'install-theme',
[643] Fix | Delete
'theme' => urlencode( $parent_theme_name ),
[644] Fix | Delete
),
[645] Fix | Delete
admin_url( 'update.php' )
[646] Fix | Delete
);
[647] Fix | Delete
$install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
[648] Fix | Delete
?>
[649] Fix | Delete
<td><a href="<?php echo esc_url( $install_url ); ?>" class="button install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td>
[650] Fix | Delete
<?php
[651] Fix | Delete
}
[652] Fix | Delete
}
[653] Fix | Delete
?>
[654] Fix | Delete
</tr>
[655] Fix | Delete
<?php endforeach; ?>
[656] Fix | Delete
</table>
[657] Fix | Delete
</div>
[658] Fix | Delete
[659] Fix | Delete
<?php
[660] Fix | Delete
}
[661] Fix | Delete
?>
[662] Fix | Delete
</div><!-- .wrap -->
[663] Fix | Delete
[664] Fix | Delete
<?php
[665] Fix | Delete
[666] Fix | Delete
/**
[667] Fix | Delete
* Returns the JavaScript template used to display the auto-update setting for a theme.
[668] Fix | Delete
*
[669] Fix | Delete
* @since 5.5.0
[670] Fix | Delete
*
[671] Fix | Delete
* @return string The template for displaying the auto-update setting link.
[672] Fix | Delete
*/
[673] Fix | Delete
function wp_theme_auto_update_setting_template() {
[674] Fix | Delete
$template = '
[675] Fix | Delete
<div class="theme-autoupdate">
[676] Fix | Delete
<# if ( data.autoupdate.supported ) { #>
[677] Fix | Delete
<# if ( data.autoupdate.forced === false ) { #>
[678] Fix | Delete
' . __( 'Auto-updates disabled' ) . '
[679] Fix | Delete
<# } else if ( data.autoupdate.forced ) { #>
[680] Fix | Delete
' . __( 'Auto-updates enabled' ) . '
[681] Fix | Delete
<# } else if ( data.autoupdate.enabled ) { #>
[682] Fix | Delete
<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable">
[683] Fix | Delete
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Disable auto-updates' ) . '</span>
[684] Fix | Delete
</button>
[685] Fix | Delete
<# } else { #>
[686] Fix | Delete
<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable">
[687] Fix | Delete
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Enable auto-updates' ) . '</span>
[688] Fix | Delete
</button>
[689] Fix | Delete
<# } #>
[690] Fix | Delete
<# } #>
[691] Fix | Delete
<# if ( data.hasUpdate ) { #>
[692] Fix | Delete
<# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #>
[693] Fix | Delete
<span class="auto-update-time">
[694] Fix | Delete
<# } else { #>
[695] Fix | Delete
<span class="auto-update-time hidden">
[696] Fix | Delete
<# } #>
[697] Fix | Delete
<br />' . wp_get_auto_update_message() . '</span>
[698] Fix | Delete
<# } #>
[699] Fix | Delete
<div class="notice notice-error notice-alt inline hidden"><p></p></div>
[700] Fix | Delete
</div>
[701] Fix | Delete
';
[702] Fix | Delete
[703] Fix | Delete
/**
[704] Fix | Delete
* Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay).
[705] Fix | Delete
*
[706] Fix | Delete
* See {@see wp_prepare_themes_for_js()} for the properties of the `data` object.
[707] Fix | Delete
*
[708] Fix | Delete
* @since 5.5.0
[709] Fix | Delete
*
[710] Fix | Delete
* @param string $template The template for displaying the auto-update setting link.
[711] Fix | Delete
*/
[712] Fix | Delete
return apply_filters( 'theme_auto_update_setting_template', $template );
[713] Fix | Delete
}
[714] Fix | Delete
[715] Fix | Delete
/*
[716] Fix | Delete
* The tmpl-theme template is synchronized with PHP above!
[717] Fix | Delete
*/
[718] Fix | Delete
?>
[719] Fix | Delete
<script id="tmpl-theme" type="text/template">
[720] Fix | Delete
<# if ( data.screenshot[0] ) { #>
[721] Fix | Delete
<div class="theme-screenshot">
[722] Fix | Delete
<img src="{{ data.screenshot[0] }}" alt="" />
[723] Fix | Delete
</div>
[724] Fix | Delete
<# } else { #>
[725] Fix | Delete
<div class="theme-screenshot blank"></div>
[726] Fix | Delete
<# } #>
[727] Fix | Delete
[728] Fix | Delete
<# if ( data.hasUpdate ) { #>
[729] Fix | Delete
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>
[730] Fix | Delete
<div class="update-message notice inline notice-warning notice-alt"><p>
[731] Fix | Delete
<# if ( data.hasPackage ) { #>
[732] Fix | Delete
<?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?>
[733] Fix | Delete
<# } else { #>
[734] Fix | Delete
<?php _e( 'New version available.' ); ?>
[735] Fix | Delete
<# } #>
[736] Fix | Delete
</p></div>
[737] Fix | Delete
<# } else { #>
[738] Fix | Delete
<div class="update-message notice inline notice-error notice-alt"><p>
[739] Fix | Delete
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
[740] Fix | Delete
<?php
[741] Fix | Delete
printf(
[742] Fix | Delete
/* translators: %s: Theme name. */
[743] Fix | Delete
__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
[744] Fix | Delete
'{{{ data.name }}}'
[745] Fix | Delete
);
[746] Fix | Delete
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
[747] Fix | Delete
printf(
[748] Fix | Delete
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
[749] Fix | Delete
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
[750] Fix | Delete
self_admin_url( 'update-core.php' ),
[751] Fix | Delete
esc_url( wp_get_update_php_url() )
[752] Fix | Delete
);
[753] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[754] Fix | Delete
} elseif ( current_user_can( 'update_core' ) ) {
[755] Fix | Delete
printf(
[756] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[757] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[758] Fix | Delete
self_admin_url( 'update-core.php' )
[759] Fix | Delete
);
[760] Fix | Delete
} elseif ( current_user_can( 'update_php' ) ) {
[761] Fix | Delete
printf(
[762] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[763] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[764] Fix | Delete
esc_url( wp_get_update_php_url() )
[765] Fix | Delete
);
[766] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[767] Fix | Delete
}
[768] Fix | Delete
?>
[769] Fix | Delete
<# } else if ( ! data.updateResponse.compatibleWP ) { #>
[770] Fix | Delete
<?php
[771] Fix | Delete
printf(
[772] Fix | Delete
/* translators: %s: Theme name. */
[773] Fix | Delete
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
[774] Fix | Delete
'{{{ data.name }}}'
[775] Fix | Delete
);
[776] Fix | Delete
if ( current_user_can( 'update_core' ) ) {
[777] Fix | Delete
printf(
[778] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[779] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[780] Fix | Delete
self_admin_url( 'update-core.php' )
[781] Fix | Delete
);
[782] Fix | Delete
}
[783] Fix | Delete
?>
[784] Fix | Delete
<# } else if ( ! data.updateResponse.compatiblePHP ) { #>
[785] Fix | Delete
<?php
[786] Fix | Delete
printf(
[787] Fix | Delete
/* translators: %s: Theme name. */
[788] Fix | Delete
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
[789] Fix | Delete
'{{{ data.name }}}'
[790] Fix | Delete
);
[791] Fix | Delete
if ( current_user_can( 'update_php' ) ) {
[792] Fix | Delete
printf(
[793] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[794] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[795] Fix | Delete
esc_url( wp_get_update_php_url() )
[796] Fix | Delete
);
[797] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[798] Fix | Delete
}
[799] Fix | Delete
?>
[800] Fix | Delete
<# } #>
[801] Fix | Delete
</p></div>
[802] Fix | Delete
<# } #>
[803] Fix | Delete
<# } #>
[804] Fix | Delete
[805] Fix | Delete
<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>
[806] Fix | Delete
<div class="notice notice-error notice-alt"><p>
[807] Fix | Delete
<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
[808] Fix | Delete
<?php
[809] Fix | Delete
_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
[810] Fix | Delete
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
[811] Fix | Delete
printf(
[812] Fix | Delete
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
[813] Fix | Delete
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
[814] Fix | Delete
self_admin_url( 'update-core.php' ),
[815] Fix | Delete
esc_url( wp_get_update_php_url() )
[816] Fix | Delete
);
[817] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[818] Fix | Delete
} elseif ( current_user_can( 'update_core' ) ) {
[819] Fix | Delete
printf(
[820] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[821] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[822] Fix | Delete
self_admin_url( 'update-core.php' )
[823] Fix | Delete
);
[824] Fix | Delete
} elseif ( current_user_can( 'update_php' ) ) {
[825] Fix | Delete
printf(
[826] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[827] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[828] Fix | Delete
esc_url( wp_get_update_php_url() )
[829] Fix | Delete
);
[830] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[831] Fix | Delete
}
[832] Fix | Delete
?>
[833] Fix | Delete
<# } else if ( ! data.compatibleWP ) { #>
[834] Fix | Delete
<?php
[835] Fix | Delete
_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
[836] Fix | Delete
if ( current_user_can( 'update_core' ) ) {
[837] Fix | Delete
printf(
[838] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[839] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[840] Fix | Delete
self_admin_url( 'update-core.php' )
[841] Fix | Delete
);
[842] Fix | Delete
}
[843] Fix | Delete
?>
[844] Fix | Delete
<# } else if ( ! data.compatiblePHP ) { #>
[845] Fix | Delete
<?php
[846] Fix | Delete
_e( 'This theme doesn&#8217;t work with your version of PHP.' );
[847] Fix | Delete
if ( current_user_can( 'update_php' ) ) {
[848] Fix | Delete
printf(
[849] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[850] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[851] Fix | Delete
esc_url( wp_get_update_php_url() )
[852] Fix | Delete
);
[853] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[854] Fix | Delete
}
[855] Fix | Delete
?>
[856] Fix | Delete
<# } #>
[857] Fix | Delete
</p></div>
[858] Fix | Delete
<# } #>
[859] Fix | Delete
[860] Fix | Delete
<span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span>
[861] Fix | Delete
<div class="theme-author">
[862] Fix | Delete
<?php
[863] Fix | Delete
/* translators: %s: Theme author name. */
[864] Fix | Delete
printf( __( 'By %s' ), '{{{ data.author }}}' );
[865] Fix | Delete
?>
[866] Fix | Delete
</div>
[867] Fix | Delete
[868] Fix | Delete
<div class="theme-id-container">
[869] Fix | Delete
<# if ( data.active ) { #>
[870] Fix | Delete
<h2 class="theme-name" id="{{ data.id }}-name">
[871] Fix | Delete
<span><?php _ex( 'Active:', 'theme' ); ?></span> {{{ data.name }}}
[872] Fix | Delete
</h2>
[873] Fix | Delete
<# } else { #>
[874] Fix | Delete
<h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2>
[875] Fix | Delete
<# } #>
[876] Fix | Delete
[877] Fix | Delete
<div class="theme-actions">
[878] Fix | Delete
<# if ( data.active ) { #>
[879] Fix | Delete
<# if ( data.actions.customize ) { #>
[880] Fix | Delete
<a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
[881] Fix | Delete
<# } #>
[882] Fix | Delete
<# } else { #>
[883] Fix | Delete
<# if ( data.compatibleWP && data.compatiblePHP ) { #>
[884] Fix | Delete
<?php
[885] Fix | Delete
/* translators: %s: Theme name. */
[886] Fix | Delete
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
[887] Fix | Delete
?>
[888] Fix | Delete
<a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
[889] Fix | Delete
<a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
[890] Fix | Delete
<# } else { #>
[891] Fix | Delete
<?php
[892] Fix | Delete
/* translators: %s: Theme name. */
[893] Fix | Delete
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
[894] Fix | Delete
?>
[895] Fix | Delete
<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
[896] Fix | Delete
<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
[897] Fix | Delete
<# } #>
[898] Fix | Delete
<# } #>
[899] Fix | Delete
</div>
[900] Fix | Delete
</div>
[901] Fix | Delete
</script>
[902] Fix | Delete
[903] Fix | Delete
<script id="tmpl-theme-single" type="text/template">
[904] Fix | Delete
<div class="theme-backdrop"></div>
[905] Fix | Delete
<div class="theme-wrap wp-clearfix" role="document">
[906] Fix | Delete
<div class="theme-header">
[907] Fix | Delete
<button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
[908] Fix | Delete
<button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
[909] Fix | Delete
<button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button>
[910] Fix | Delete
</div>
[911] Fix | Delete
<div class="theme-about wp-clearfix">
[912] Fix | Delete
<div class="theme-screenshots">
[913] Fix | Delete
<# if ( data.screenshot[0] ) { #>
[914] Fix | Delete
<div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
[915] Fix | Delete
<# } else { #>
[916] Fix | Delete
<div class="screenshot blank"></div>
[917] Fix | Delete
<# } #>
[918] Fix | Delete
</div>
[919] Fix | Delete
[920] Fix | Delete
<div class="theme-info">
[921] Fix | Delete
<# if ( data.active ) { #>
[922] Fix | Delete
<span class="current-label"><?php _e( 'Current Theme' ); ?></span>
[923] Fix | Delete
<# } #>
[924] Fix | Delete
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version">
[925] Fix | Delete
<?php
[926] Fix | Delete
/* translators: %s: Theme version. */
[927] Fix | Delete
printf( __( 'Version: %s' ), '{{ data.version }}' );
[928] Fix | Delete
?>
[929] Fix | Delete
</span></h2>
[930] Fix | Delete
<p class="theme-author">
[931] Fix | Delete
<?php
[932] Fix | Delete
/* translators: %s: Theme author link. */
[933] Fix | Delete
printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );
[934] Fix | Delete
?>
[935] Fix | Delete
</p>
[936] Fix | Delete
[937] Fix | Delete
<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>
[938] Fix | Delete
<div class="notice notice-error notice-alt notice-large"><p>
[939] Fix | Delete
<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
[940] Fix | Delete
<?php
[941] Fix | Delete
_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
[942] Fix | Delete
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
[943] Fix | Delete
printf(
[944] Fix | Delete
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
[945] Fix | Delete
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
[946] Fix | Delete
self_admin_url( 'update-core.php' ),
[947] Fix | Delete
esc_url( wp_get_update_php_url() )
[948] Fix | Delete
);
[949] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[950] Fix | Delete
} elseif ( current_user_can( 'update_core' ) ) {
[951] Fix | Delete
printf(
[952] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[953] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[954] Fix | Delete
self_admin_url( 'update-core.php' )
[955] Fix | Delete
);
[956] Fix | Delete
} elseif ( current_user_can( 'update_php' ) ) {
[957] Fix | Delete
printf(
[958] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[959] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[960] Fix | Delete
esc_url( wp_get_update_php_url() )
[961] Fix | Delete
);
[962] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[963] Fix | Delete
}
[964] Fix | Delete
?>
[965] Fix | Delete
<# } else if ( ! data.compatibleWP ) { #>
[966] Fix | Delete
<?php
[967] Fix | Delete
_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
[968] Fix | Delete
if ( current_user_can( 'update_core' ) ) {
[969] Fix | Delete
printf(
[970] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[971] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[972] Fix | Delete
self_admin_url( 'update-core.php' )
[973] Fix | Delete
);
[974] Fix | Delete
}
[975] Fix | Delete
?>
[976] Fix | Delete
<# } else if ( ! data.compatiblePHP ) { #>
[977] Fix | Delete
<?php
[978] Fix | Delete
_e( 'This theme doesn&#8217;t work with your version of PHP.' );
[979] Fix | Delete
if ( current_user_can( 'update_php' ) ) {
[980] Fix | Delete
printf(
[981] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[982] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[983] Fix | Delete
esc_url( wp_get_update_php_url() )
[984] Fix | Delete
);
[985] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[986] Fix | Delete
}
[987] Fix | Delete
?>
[988] Fix | Delete
<# } #>
[989] Fix | Delete
</p></div>
[990] Fix | Delete
<# } #>
[991] Fix | Delete
[992] Fix | Delete
<# if ( data.hasUpdate ) { #>
[993] Fix | Delete
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>
[994] Fix | Delete
<div class="notice notice-warning notice-alt notice-large">
[995] Fix | Delete
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
[996] Fix | Delete
{{{ data.update }}}
[997] Fix | Delete
</div>
[998] Fix | Delete
<# } else { #>
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function