-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalhyperlocal.php
More file actions
113 lines (106 loc) · 3.09 KB
/
talhyperlocal.php
File metadata and controls
113 lines (106 loc) · 3.09 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
112
113
<?php
/*
Plugin Name: Talk About Local Hyperlocal Sites Directory
Plugin URI:
Description:
Version: 0.1.3
Author: Adrian Short
Author URI: https://adrianshort.org/
License: GPL v3
*/
require_once ( dirname( __FILE__ ) . '/includes/map.php' );
/**
* Create custom post types and taxonomies
* @return void
*/
function talhyperlocal_init() {
// Create 'site' custom post type
$args = array(
'labels' => array(
'name' => 'Sites',
'singular_name' => 'Site',
'add_new_item' => 'Add a New Site',
),
'description' => 'Hyperlocal website',
'public' => true,
'show_ui' => true,
'has_archive' => true,
'show_in_menu' => true,
'exclude_from_search' => false,
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => array(
'slug' => 'site',
'with_front' => true,
),
'query_var' => true,
'supports' => array(
'title',
'editor',
'custom-fields',
),
);
register_post_type( 'site', $args );
// Create taxonomy: Councils
$args = array(
'labels' => array(
'name' => 'Councils',
),
'hierarchical' => false,
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'councils',
'with_front' => true,
),
'show_admin_column' => true,
);
register_taxonomy( 'councils', array( 'site' ), $args );
// Create taxonomy: Countries
$args = array(
'labels' => array(
'name' => 'Countries',
),
'hierarchical' => false,
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'countries',
'with_front' => true,
),
'show_admin_column' => true,
);
register_taxonomy( 'countries', array( 'site' ), $args );
// Create taxonomy: Hyperlocal Groups
$args = array(
'labels' => array(
'name' => 'Groups',
),
'hierarchical' => false,
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'groups',
'with_front' => true,
),
'show_admin_column' => true,
);
register_taxonomy( 'groups', array( 'site' ), $args );
// Create taxonomy: Platforms
$args = array(
'labels' => array(
'name' => 'Platforms',
),
'hierarchical' => false,
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'platforms',
'with_front' => true,
),
'show_admin_column' => true,
);
register_taxonomy( 'platforms', array( 'site' ), $args );
}
add_action( 'init', 'talhyperlocal_init' );