Merge pull request #5754 from claudiosmweb/5753-feature-system-status-theme-support
Add theme support to system status page
This commit is contained in:
commit
13e2ffe955
|
@ -57,7 +57,7 @@ class WC_Admin_Notices {
|
||||||
if ( in_array( 'theme_support', $notices ) && ! current_theme_supports( 'woocommerce' ) ) {
|
if ( in_array( 'theme_support', $notices ) && ! current_theme_supports( 'woocommerce' ) ) {
|
||||||
$template = get_option( 'template' );
|
$template = get_option( 'template' );
|
||||||
|
|
||||||
if ( ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) {
|
if ( ! in_array( $template, wc_get_core_supported_themes() ) ) {
|
||||||
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', WC_PLUGIN_FILE ) );
|
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', WC_PLUGIN_FILE ) );
|
||||||
add_action( 'admin_notices', array( $this, 'theme_check_notice' ) );
|
add_action( 'admin_notices', array( $this, 'theme_check_notice' ) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,15 +382,15 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$active_theme = wp_get_theme();
|
$active_theme = wp_get_theme();
|
||||||
if ( $active_theme->{'Author URI'} == 'http://www.woothemes.com' ) :
|
if ( $active_theme->{'Author URI'} == 'http://www.woothemes.com' ) :
|
||||||
|
|
||||||
$theme_dir = substr( strtolower( str_replace( ' ','', $active_theme->Name ) ), 0, 45 );
|
$theme_dir = substr( strtolower( str_replace( ' ','', $active_theme->Name ) ), 0, 45 );
|
||||||
|
|
||||||
if ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) :
|
if ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) :
|
||||||
|
|
||||||
$theme_changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' );
|
$theme_changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' );
|
||||||
$cl_lines = explode( "\n", wp_remote_retrieve_body( $theme_changelog ) );
|
$cl_lines = explode( "\n", wp_remote_retrieve_body( $theme_changelog ) );
|
||||||
if ( ! empty( $cl_lines ) ) :
|
if ( ! empty( $cl_lines ) ) :
|
||||||
|
|
||||||
|
@ -414,27 +414,37 @@
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php _e( 'Theme Name', 'woocommerce' ); ?>:</td>
|
<td><?php _e( 'Theme Name', 'woocommerce' ); ?>:</td>
|
||||||
<td><?php
|
<td><?php
|
||||||
echo $active_theme->Name;
|
echo $active_theme->Name;
|
||||||
?></td>
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php _e( 'Theme Version', 'woocommerce' ); ?>:</td>
|
<td><?php _e( 'Theme Version', 'woocommerce' ); ?>:</td>
|
||||||
<td><?php
|
<td><?php
|
||||||
echo $active_theme->Version;
|
echo $active_theme->Version;
|
||||||
|
|
||||||
if ( ! empty( $theme_version_data['version'] ) && version_compare( $theme_version_data['version'], $active_theme->Version, '!=' ) )
|
if ( ! empty( $theme_version_data['version'] ) && version_compare( $theme_version_data['version'], $active_theme->Version, '!=' ) )
|
||||||
echo ' – <strong style="color:red;">' . $theme_version_data['version'] . ' ' . __( 'is available', 'woocommerce' ) . '</strong>';
|
echo ' – <strong style="color:red;">' . $theme_version_data['version'] . ' ' . __( 'is available', 'woocommerce' ) . '</strong>';
|
||||||
?></td>
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php _e( 'Author URL', 'woocommerce' ); ?>:</td>
|
<td><?php _e( 'Author URL', 'woocommerce' ); ?>:</td>
|
||||||
<td><?php
|
<td><?php
|
||||||
echo $active_theme->{'Author URI'};
|
echo $active_theme->{'Author URI'};
|
||||||
?></td>
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'WooCommerce Support', 'woocommerce' ); ?>:</td>
|
||||||
|
<td><?php
|
||||||
|
if ( ! current_theme_supports( 'woocommerce' ) && ! in_array( $active_theme->template, wc_get_core_supported_themes() ) ) {
|
||||||
|
echo '<mark class="error">' . __( 'Not Declared', 'woocommerce' ) . '</mark>';
|
||||||
|
} else {
|
||||||
|
echo '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>';
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
@ -602,3 +602,13 @@ function wc_remove_order_notes_from_wp_count_comments( $stats, $post_id ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter( 'wp_count_comments', 'wc_remove_order_notes_from_wp_count_comments', 10, 2 );
|
add_filter( 'wp_count_comments', 'wc_remove_order_notes_from_wp_count_comments', 10, 2 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WooCommerce Core Supported Themes
|
||||||
|
*
|
||||||
|
* @since 2.2
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function wc_get_core_supported_themes() {
|
||||||
|
return array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' );
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue