Sticky.php
956 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
<?php
namespace ACA\EC\Column\Event;
use AC;
use ACA\EC\Editing;
use ACA\EC\Filtering;
use ACA\EC\Search;
use ACA\EC\Service\ColumnGroups;
use ACP;
class Sticky extends AC\Column
implements ACP\Filtering\Filterable, ACP\Editing\Editable, ACP\Search\Searchable {
public function __construct() {
$this->set_type( 'column-ec-event_sticky' )
->set_label( __( 'Sticky in Month View', 'codepress-admin-columns' ) )
->set_group( ColumnGroups::EVENTS_CALENDAR );
}
public function get_value( $post_id ) {
$value = $this->get_raw_value( $post_id );
return ac_helper()->icon->yes_or_no( -1 === $value );
}
public function get_raw_value( $post_id ) {
return get_post_field( 'menu_order', $post_id );
}
public function filtering() {
return new Filtering\Event\Sticky( $this );
}
public function editing() {
return new Editing\Service\Event\Sticky();
}
public function search() {
return new Search\Event\Sticky();
}
}