Add button to tools page to reset usage settings.

This commit is contained in:
Gerhard 2014-11-27 09:43:43 +02:00
parent 144c683d7b
commit 69553d53ab
1 changed files with 11 additions and 0 deletions

View File

@ -141,6 +141,12 @@ class WC_Admin_Status {
echo '<div class="updated"><p>' . __( 'Translation update message hidden successfully!', 'woocommerce' ) . '</p></div>';
break;
case 'reset_tracking' :
update_option( 'woocommerce_allow_tracking', false );
update_option( 'woocommerce_hide_tracking_notice', false );
echo '<div class="updated"><p>' . __( 'Usage tracking settings reseted successfully!', 'woocommerce' ) . '</p></div>';
break;
default :
$action = esc_attr( $_GET['action'] );
if ( isset( $tools[ $action ]['callback'] ) ) {
@ -230,6 +236,11 @@ class WC_Admin_Status {
'name' => __( 'Delete all WooCommerce tax rates', 'woocommerce' ),
'button' => __( 'Delete ALL tax rates', 'woocommerce' ),
'desc' => __( '<strong class="red">Note:</strong> This option will delete ALL of your tax rates, use with caution.', 'woocommerce' ),
),
'reset_tracking' => array(
'name' => __( 'Reset Usage Tracking Settings', 'woocommerce' ),
'button' => __( 'Reset usage tracking settings', 'woocommerce' ),
'desc' => __( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'woocommerce' ),
)
);