-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChefFilterColumn.php
More file actions
executable file
·111 lines (77 loc) · 2.01 KB
/
Copy pathChefFilterColumn.php
File metadata and controls
executable file
·111 lines (77 loc) · 2.01 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/**
* Plugin Name: Chef Filter Column
* Plugin URI: http://chefduweb.nl/plugins/chef-filter-column
* Description: Filter collections based on taxonomy
* Version: 1.0.0
* Author: Luc Princen
* Author URI: http://www.chefduweb.nl/
* License: GPLv2
*
* @package ChefSections
* @category ColumnTypes
* @author Chef du Web
*/
//Chaning the namespaces is the most important part,
//after that the bus pretty much drives itself.
namespace ChefFilterColumn;
use Cuisine\Wrappers\Script;
use Cuisine\Wrappers\Sass;
use Cuisine\Utilities\Url;
class ColumnIgniter{
/**
* Static bootstrapped ChefFilterColumn\ColumnIgniter instance.
*
* @var \ChefFilterColumn\ColumnIgniter
*/
public static $instance = null;
/**
* Init admin events & vars
*/
function __construct(){
//register column:
$this->register();
//load the right files
$this->load();
}
/**
* Register this column-type with Chef Sections
*
* @return void
*/
private function register(){
add_filter( 'chef_sections_column_types', function( $types ){
$base = Url::path( 'plugin', 'chef-filter-column', true );
//change the $types[ key ] and the name value:
$types['filter'] = array(
'name' => 'Filter kolom',
'class' => 'ChefFilterColumn\Column',
'template' => $base.'Assets/template.php'
);
return $types;
});
}
/**
* Load all includes for this plugin
*
* @return void
*/
private function load(){
include( 'Classes/Column.php' );
include( 'Classes/EventListeners.php' );
}
/*=============================================================*/
/** Getters & Setters */
/*=============================================================*/
/**
* Init the \ChefFilterColumn\ColumnIgniter Class
*
* @return \ChefFilterColumn\ColumnIgniter
*/
public static function getInstance(){
return static::$instance = new static();
}
}
add_action('chef_sections_loaded', function(){
\ChefFilterColumn\ColumnIgniter::getInstance();
});