ListScreens.php
843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace ACA\WC\Service;
use AC;
use AC\Registerable;
use ACA\WC\ListScreen;
class ListScreens implements Registerable {
/**
* @var bool
*/
private $use_product_variations;
public function __construct( $use_product_variations ) {
$this->use_product_variations = $use_product_variations;
}
public function register() {
add_action( 'ac/list_screens', [ $this, 'register_list_screens' ] );
}
public function register_list_screens() {
$list_screens = [
new ListScreen\ShopOrder(),
new ListScreen\ShopCoupon(),
new ListScreen\Product(),
new ListScreen\ProductCategory(),
];
if ( $this->use_product_variations ) {
$list_screens[] = new ListScreen\ProductVariation;
}
foreach ( $list_screens as $list_screen ) {
AC\ListScreenTypes::instance()->register_list_screen( $list_screen );
}
}
}