EventDisplay.php
1016 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace ACA\EC\Settings;
use AC;
use AC\View;
class EventDisplay extends AC\Settings\Column {
/**
* @var string
*/
private $event_display;
/**
* @return string
*/
public function get_event_display() {
return $this->event_display;
}
/**
* @param string $event_display
*/
public function set_event_display( $event_display ) {
$this->event_display = $event_display;
}
protected function define_options() {
return [
'event_display' => 'all',
];
}
public function create_view() {
$select = $this->create_element( 'select' )
->set_options( $this->get_date_options() );
$view = new View( [
'label' => __( 'Show Events', 'codepress-admin-columns' ),
'setting' => $select,
] );
return $view;
}
protected function get_date_options() {
$options = [
'all' => __( 'All' ),
'future' => __( 'Upcoming Events', 'codepress-admin-columns' ),
'past' => __( 'Past Events', 'codepress-admin-columns' ),
];
return $options;
}
}