1 <?php
2
3 4 5 6 7 8 9 10 11
12
13 namespace WC_POS;
14
15 class Admin {
16
17 18 19
20 public function __construct() {
21 $this->init();
22 add_action( 'current_screen', array( $this, 'conditional_init' ) );
23 }
24
25 26 27
28 private function init() {
29 new Admin\Notices();
30 new Admin\Menu();
31 new Admin\Settings();
32 new Admin\Status();
33 new Admin\Gateways();
34 }
35
36 37 38 39
40 public function conditional_init( $current_screen ) {
41
42
43 if( $current_screen->id == 'options-permalink' )
44 new Admin\Permalink();
45
46
47 if( $current_screen->id == 'shop_order' || $current_screen->id == 'edit-shop_order' )
48 new Admin\Orders();
49
50
51 if( $current_screen->id == 'plugins' )
52 new Admin\Plugins();
53
54 }
55
56 }