Output foreach loop used in WordPress wp_customize

The code you have in question (switch ( $box )) won’t work because the value of the $box variable is in the form of <value>,<value>,<value>,..., i.e. comma-separated list of values (like the default ones hereauthor,categories,comments), so in order to get access to each value in that list, you’d want to parse the values into an array, e.g. using the native explode() function in PHP, just like how the theme author did it.

Then after that, just loop through the array and run the switch call for each item in the array. (Note that the items are already in the same order they were placed via the Customizer)

Working Example

$list = explode( ',', $box );

foreach ( $list as $value ) {
    switch ( $value ) {
        case 'author':
            echo 'Author';
            break;

        case 'date':
            echo 'Date';
            break;

        // ... your code.
    }
}

PS: Just a gentle reminder — if you need a generic PHP help like this again, you should ask on Stack Overflow.. =)