-
Notifications
You must be signed in to change notification settings - Fork 1
/
ihh-post-types.php
74 lines (66 loc) · 1.52 KB
/
ihh-post-types.php
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
<?php
/*
Plugin Name: IHH Post Types
Plugin URI: https://digia.com
Description: Generate post types used in theme
Version: 1.0
Author: Digialist
Author URI: https://digia.com
License: MIT
*/
namespace IHH;
use PostTypes\PostType;
/**
* Notifications
*/
$notifications = new PostType( [
'name' => 'notification',
'singular' => __( 'Notification', 'ihh' ),
'plural' => __( 'Notifications', 'ihh' ),
'slug' => 'notifications',
], [
'supports' => [ 'title', 'editor' ],
'menu_position' => 5,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => false,
] );
$notifications->icon( 'dashicons-warning' );
$notifications->register();
/**
* Events
*/
$events = new PostType( [
'name' => 'event',
'singular' => __( 'Event', 'ihh' ),
'plural' => __( 'Events', 'ihh' ),
'slug' => 'events',
], [
'supports' => [ 'title', 'editor', 'thumbnail' ],
'menu_position' => 6,
'has_archive' => false,
'rewrite' => [
'with_front' => false,
],
] );
$events->icon( 'dashicons-calendar-alt' );
$events->register();
/**
* Services
*/
$services = new PostType( [
'name' => 'service',
'singular' => __( 'Service', 'ihh' ),
'plural' => __( 'Services', 'ihh' ),
'slug' => 'services',
], [
'supports' => [ 'title', 'editor', 'thumbnail' ],
'menu_position' => 7,
'hierarchical' => true,
'has_archive' => false,
'rewrite' => [
'with_front' => false,
],
] );
$services->icon( 'dashicons-edit' );
$services->register();