introduces the wc_get_core_supported_themes() function
This commit is contained in:
parent
04f9361de7
commit
2b1a99eca6
|
@ -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' ) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -438,7 +438,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php _e( 'WooCommerce Support', 'woocommerce' ); ?>:</td>
|
<td><?php _e( 'WooCommerce Support', 'woocommerce' ); ?>:</td>
|
||||||
<td><?php
|
<td><?php
|
||||||
if ( ! current_theme_supports( 'woocommerce' ) && ! in_array( $active_theme->template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) {
|
if ( ! current_theme_supports( 'woocommerce' ) && ! in_array( $active_theme->template, wc_get_core_supported_themes() ) ) {
|
||||||
echo '<mark class="error">' . __( 'Not Declared', 'woocommerce' ) . '</mark>';
|
echo '<mark class="error">' . __( 'Not Declared', 'woocommerce' ) . '</mark>';
|
||||||
} else {
|
} else {
|
||||||
echo '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>';
|
echo '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>';
|
||||||
|
|
|
@ -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