Made WC_TEMPLATE_DEBUG_MODE a constant only

This commit is contained in:
Mike Jolley 2016-08-24 16:46:07 +01:00
parent c8726cc42b
commit 2dc3e5252f
2 changed files with 1 additions and 15 deletions

View File

@ -893,21 +893,6 @@ function wc_deliver_webhook_async( $webhook_id, $arg ) {
}
add_action( 'woocommerce_deliver_webhook_async', 'wc_deliver_webhook_async', 10, 2 );
/**
* Enables template debug mode.
*/
function wc_template_debug_mode() {
if ( ! defined( 'WC_TEMPLATE_DEBUG_MODE' ) ) {
$status_options = get_option( 'woocommerce_status_options', array() );
if ( ! empty( $status_options['template_debug_mode'] ) && current_user_can( 'manage_options' ) ) {
define( 'WC_TEMPLATE_DEBUG_MODE', true );
} else {
define( 'WC_TEMPLATE_DEBUG_MODE', false );
}
}
}
add_action( 'after_setup_theme', 'wc_template_debug_mode', 20 );
/**
* Formats a string in the format COUNTRY:STATE into an array.
*

View File

@ -188,6 +188,7 @@ final class WooCommerce {
$this->define( 'WC_DELIMITER', '|' );
$this->define( 'WC_LOG_DIR', $upload_dir['basedir'] . '/wc-logs/' );
$this->define( 'WC_SESSION_CACHE_GROUP', 'wc_session_id' );
$this->define( 'WC_TEMPLATE_DEBUG_MODE', false );
}
/**