Fetch current_channel programatically

This commit is contained in:
Gerhard Potgieter 2018-06-05 13:45:09 +02:00
parent fb311efe08
commit 5fbefe30c3
1 changed files with 16 additions and 2 deletions

View File

@ -41,8 +41,22 @@ class WC_Beta_Tester_Admin_Menus {
'title' => __( 'WC Beta Tester', 'woocommerce-beta-tester' ),
) );
// TODO: Retrieve this programmatically.
$current_channel = 'test';
$current_channel = __( 'Release Candidate', 'woocommerce-beta-tester' );
$options = get_option( 'wc_beta_tester_options' );
if ( isset( $options['wc-beta-tester-version'] ) ) {
switch ( $options['wc-beta-tester-version'] ) {
case 'beta':
$current_channel = __( 'Beta', 'woocommerce-beta-tester' );
break;
case 'rc':
$current_channel = __( 'Release Candidate', 'woocommerce-beta-tester' );
break;
default:
$current_channel = __( 'Stable', 'woocommerce-beta-tester' );
break;
}
}
// TODO: Implementation of each node.
$nodes = array(