AutoRenewal.php
872 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
<?php
namespace ACA\WC\Column\OrderSubscription;
use AC;
use ACA\WC\Search;
use ACA\WC\Sorting;
use ACP;
class AutoRenewal extends AC\Column implements ACP\Search\Searchable, ACP\Sorting\Sortable
{
public function __construct()
{
$this->set_type('column_wc_auto_renewal')
->set_group('woocommerce_subscriptions')
->set_label(__('Auto Renewal', 'codepress-admin-columns'));
}
public function get_value($id)
{
return ac_helper()->icon->yes_or_no(! $this->get_raw_value($id));
}
public function get_raw_value($id)
{
return wcs_get_subscription($id)->is_manual();
}
public function search()
{
return new Search\OrderSubscription\AutoRenewal();
}
public function sorting()
{
return new Sorting\Order\OrderMeta('_requires_manual_renewal');
}
}