-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathac-column-types.php
More file actions
30 lines (25 loc) · 915 Bytes
/
ac-column-types.php
File metadata and controls
30 lines (25 loc) · 915 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
<?php
/**
* A full working example is provided in the 'ac-column-template' plugin.
* @see https://github.com/codepress/ac-column-template/
*/
add_filter('ac/column/types', static function (array $factories, AC\TableScreen $table_screen): array {
// Include file with the column class
require_once __DIR__ . '/classes/MyExampleColumn.php';
// Register for the page post type table
if ('page' === (string)$table_screen->get_id()) {
$factories[] = MyExampleColumn::class;
}
// Register for the User table
if ($table_screen instanceof AC\TableScreen\User) {
$factories[] = MyExampleColumn::class;
}
// Register for the Taxonomy table
if (
$table_screen instanceof ACP\TableScreen\Taxonomy &&
'category' === (string)$table_screen->get_taxonomy()
) {
$factories[] = MyExampleColumn::class;
}
return $factories;
}, 10, 2);