PostCount.php
745 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
<?php
namespace ACP\Column\User;
use AC;
use ACP\ConditionalFormat;
use ACP\Export;
use ACP\Sorting;
/**
* @since 4.0
*/
class PostCount extends AC\Column\User\PostCount
implements Sorting\Sortable, Export\Exportable, ConditionalFormat\Formattable {
use ConditionalFormat\IntegerFormattableTrait;
public function sorting() {
return new Sorting\Model\User\PostCount( $this->get_post_types(), $this->get_selected_post_status() );
}
public function export() {
return new Export\Model\StrippedValue( $this );
}
/**
* @return array
*/
private function get_post_types() {
$post_type = $this->get_selected_post_type();
if ( 'any' === $post_type ) {
$post_type = get_post_types();
}
return (array) $post_type;
}
}