11<?php
2+
23namespace JustCoded \WP \Framework \Objects ;
34
4- use JustCoded \WP \Framework \Web \View ;
5- use JustCoded \WP \Framework \Web \Views_Rule ;
65use JustCoded \WP \Framework \Supports \FakerPress ;
76
87/**
@@ -30,45 +29,45 @@ abstract class Post_Type {
3029 */
3130 public static $ SLUG ;
3231
33- const STATUS_ANY = 'any ' ;
34- const STATUS_DRAFT = 'draft ' ;
35- const STATUS_PENDING = 'pending ' ;
36- const STATUS_PUBLISH = 'publish ' ;
37- const STATUS_FUTURE = 'future ' ;
32+ const STATUS_ANY = 'any ' ;
33+ const STATUS_DRAFT = 'draft ' ;
34+ const STATUS_PENDING = 'pending ' ;
35+ const STATUS_PUBLISH = 'publish ' ;
36+ const STATUS_FUTURE = 'future ' ;
3837 const STATUS_AUTO_DRAFT = 'auto-draft ' ;
39- const STATUS_PRIVATE = 'private ' ;
40- const STATUS_INHERIT = 'inherit ' ;
38+ const STATUS_PRIVATE = 'private ' ;
39+ const STATUS_INHERIT = 'inherit ' ;
4140
42- const SORT_ASC = 'asc ' ;
41+ const SORT_ASC = 'asc ' ;
4342 const SORT_DESC = 'desc ' ;
4443
45- const ORDERBY_NONE = 'none ' ;
46- const ORDERBY_ID = 'ID ' ;
47- const ORDERBY_AUTHOR = 'author ' ;
48- const ORDERBY_TITLE = 'title ' ;
49- const ORDERBY_SLUG = 'name ' ;
50- const ORDERBY_TYPE = 'type ' ;
51- const ORDERBY_DATE = 'date ' ;
52- const ORDERBY_MODIFIED = 'modified ' ;
53- const ORDERBY_PARENT = 'parent ' ;
54- const ORDERBY_RAND = 'rand ' ;
55- const ORDERBY_COMMENTS = 'comment_count ' ;
56- const ORDERBY_WEIGHT = 'menu_order ' ;
57- const ORDERBY_META = 'meta_value ' ;
44+ const ORDERBY_NONE = 'none ' ;
45+ const ORDERBY_ID = 'ID ' ;
46+ const ORDERBY_AUTHOR = 'author ' ;
47+ const ORDERBY_TITLE = 'title ' ;
48+ const ORDERBY_SLUG = 'name ' ;
49+ const ORDERBY_TYPE = 'type ' ;
50+ const ORDERBY_DATE = 'date ' ;
51+ const ORDERBY_MODIFIED = 'modified ' ;
52+ const ORDERBY_PARENT = 'parent ' ;
53+ const ORDERBY_RAND = 'rand ' ;
54+ const ORDERBY_COMMENTS = 'comment_count ' ;
55+ const ORDERBY_WEIGHT = 'menu_order ' ;
56+ const ORDERBY_META = 'meta_value ' ;
5857 const ORDERBY_META_NUMERIC = 'meta_value_num ' ;
59- const ORDERBY_POST_IN = 'post__in ' ;
58+ const ORDERBY_POST_IN = 'post__in ' ;
6059
61- const SUPPORTS_TITLE = 'title ' ;
62- const SUPPORTS_EDITOR = 'editor ' ;
63- const SUPPORTS_AUTHOR = 'author ' ;
60+ const SUPPORTS_TITLE = 'title ' ;
61+ const SUPPORTS_EDITOR = 'editor ' ;
62+ const SUPPORTS_AUTHOR = 'author ' ;
6463 const SUPPORTS_FEATURED_IMAGE = 'thumbnail ' ;
65- const SUPPORTS_EXCERPT = 'excerpt ' ;
66- const SUPPORTS_TRACKBACKS = 'trackbacks ' ;
67- const SUPPORTS_CUSTOM_FIELDS = 'custom-fields ' ;
68- const SUPPORTS_COMMENTS = 'comments ' ; // (also will see comment count balloon on edit screen)
69- const SUPPORTS_REVISIONS = 'revisions ' ;
70- const SUPPORTS_ORDER = 'page-attributes ' ; // (menu order, hierarchical must be true to show Parent option)
71- const SUPPORTS_POST_FORMATS = 'post-formats ' ;
64+ const SUPPORTS_EXCERPT = 'excerpt ' ;
65+ const SUPPORTS_TRACKBACKS = 'trackbacks ' ;
66+ const SUPPORTS_CUSTOM_FIELDS = 'custom-fields ' ;
67+ const SUPPORTS_COMMENTS = 'comments ' ; // (also will see comment count balloon on edit screen)
68+ const SUPPORTS_REVISIONS = 'revisions ' ;
69+ const SUPPORTS_ORDER = 'page-attributes ' ; // (menu order, hierarchical must be true to show Parent option)
70+ const SUPPORTS_POST_FORMATS = 'post-formats ' ;
7271
7372 /**
7473 * Single Post Type label
@@ -266,29 +265,24 @@ public function register() {
266265 $ labels = array_merge ( $ labels , $ this ->labels );
267266
268267 $ args = array (
269- 'labels ' => $ labels ,
270- 'hierarchical ' => $ this ->is_hierarchical ,
271-
268+ 'labels ' => $ labels ,
269+ 'hierarchical ' => $ this ->is_hierarchical ,
272270 'public ' => $ this ->has_single ,
273271 'publicly_queryable ' => $ this ->has_single || $ this ->is_searchable || $ this ->redirect ,
274272 'show_in_nav_menus ' => $ this ->has_single ,
275273 'exclude_from_search ' => ! $ this ->is_searchable ,
276274 'has_archive ' => $ this ->has_archive ,
277-
278- 'show_ui ' => ! empty ( $ this ->has_admin_menu ),
279- 'show_in_menu ' => $ this ->has_admin_menu ,
280- 'menu_position ' => $ this ->admin_menu_pos ,
281- 'menu_icon ' => $ this ->admin_menu_icon ,
282-
283- 'capability_type ' => $ this ->admin_capability ,
284-
285- 'supports ' => $ this ->supports ,
286-
287- 'rewrite ' => array (
275+ 'show_ui ' => ! empty ( $ this ->has_admin_menu ),
276+ 'show_in_menu ' => $ this ->has_admin_menu ,
277+ 'menu_position ' => $ this ->admin_menu_pos ,
278+ 'menu_icon ' => $ this ->admin_menu_icon ,
279+ 'capability_type ' => $ this ->admin_capability ,
280+ 'supports ' => $ this ->supports ,
281+ 'rewrite ' => array (
288282 'slug ' => $ this ::$ SLUG ,
289283 'with_front ' => ( ! $ this ->rewrite_singular || $ this ->redirect ),
290284 ),
291- 'query_var ' => $ this ->query_var ,
285+ 'query_var ' => $ this ->query_var ,
292286 );
293287
294288 if ( ! empty ( $ this ->taxonomies ) && is_array ( $ this ->taxonomies ) ) {
@@ -323,16 +317,16 @@ public function template_redirect() {
323317 * By default point all inner CPT pages to views/{cpt}/single.php
324318 * You can write your own rules here
325319 *
326- * @param string $template Standard template file to be loaded.
320+ * @param string $template Standard template file to be loaded.
327321 *
328- * @return string Modified template file path
322+ * @return string Modified template file path
329323 */
330324 public function views ( $ template ) {
331325 /**
332326 * Example of overwrite:
333327 * if ( is_singular( $this::$ID ) ) {
334328 * $template = View::locate('section/template');
335- * }
329+ * }
336330 */
337331
338332 return $ template ;
@@ -344,4 +338,4 @@ public function views( $template ) {
344338 public function init_faker () {
345339 new FakerPress ( $ this );
346340 }
347- }
341+ }
0 commit comments