1 | <?php |
||
14 | class PostTypeBuilder |
||
15 | { |
||
16 | /** |
||
17 | * The post type slug. |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $slug; |
||
21 | |||
22 | /** |
||
23 | * The arguments to be passed when registering the post type. |
||
24 | * @var Collection |
||
25 | */ |
||
26 | protected $args; |
||
27 | |||
28 | /** |
||
29 | * The Post Type Labels |
||
30 | * @var PostTypeLabels |
||
31 | */ |
||
32 | protected $labels; |
||
33 | |||
34 | /** |
||
35 | * PostTypeBuilder constructor |
||
36 | * |
||
37 | * @param string $slug post type slug |
||
38 | * @param array $args initial registration arguments |
||
39 | */ |
||
40 | public function __construct($slug, array $args = []) |
||
49 | |||
50 | /** |
||
51 | * Create a new instance |
||
52 | * |
||
53 | * @param string $slug |
||
54 | * |
||
55 | * @return static |
||
56 | */ |
||
57 | public static function make($slug) |
||
61 | |||
62 | /** |
||
63 | * Specify which features the post type supports |
||
64 | * @param mixed $features array of features |
||
65 | * string ...$features features as parameters |
||
66 | * |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function supports($features) |
||
77 | |||
78 | /** |
||
79 | * Set the post type as publicly available |
||
80 | * |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function open() |
||
87 | |||
88 | /** |
||
89 | * Set the post type as non-publicly available |
||
90 | * |
||
91 | * @return $this |
||
92 | */ |
||
93 | public function closed() |
||
97 | |||
98 | /** |
||
99 | * Enable admin interface |
||
100 | * |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function withUI() |
||
107 | |||
108 | /** |
||
109 | * Disable admin interface |
||
110 | * |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function noUI() |
||
117 | |||
118 | /** |
||
119 | * Set the singular label for this post type |
||
120 | * |
||
121 | * @param string $singular_label |
||
122 | * |
||
123 | * @return $this |
||
124 | */ |
||
125 | public function oneIs($singular_label) |
||
131 | |||
132 | /** |
||
133 | * Set the plural label for this post type |
||
134 | * |
||
135 | * @param string $plural_label |
||
136 | * |
||
137 | * @return $this |
||
138 | */ |
||
139 | public function manyAre($plural_label) |
||
145 | |||
146 | /** |
||
147 | * Setter for post type arguments |
||
148 | * |
||
149 | * @param string $key |
||
150 | * @param mixed $value |
||
151 | * |
||
152 | * @return $this |
||
153 | */ |
||
154 | public function set($key, $value) |
||
160 | |||
161 | /** |
||
162 | * Getter for post type arguments |
||
163 | * |
||
164 | * @param string $key |
||
165 | * |
||
166 | * @return mixed |
||
167 | */ |
||
168 | public function get($key) |
||
172 | |||
173 | /** |
||
174 | * Register the post type |
||
175 | * |
||
176 | * @return PostType |
||
177 | */ |
||
178 | public function register() |
||
184 | |||
185 | /** |
||
186 | * Assemble the arguments for post type registration. |
||
187 | * |
||
188 | * @return array |
||
189 | */ |
||
190 | protected function assembleArgs() |
||
201 | |||
202 | /** |
||
203 | * Get the labels instance. |
||
204 | * |
||
205 | * @return PostTypeLabels |
||
206 | */ |
||
207 | protected function labels() |
||
215 | |||
216 | /** |
||
217 | * Magic Getter |
||
218 | * |
||
219 | * @param string $property The accessed property |
||
220 | * |
||
221 | * @return mixed |
||
222 | */ |
||
223 | public function __get($property) |
||
227 | } |
||
228 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.