-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalloy-cpt.php
96 lines (94 loc) · 2.55 KB
/
alloy-cpt.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/*
Plugin Name: Alloy CPT
Plugin URI: https://studioalloy.nl
Description: a plugin to create custom post types and taxonamies
Version: 0.1
Author: Mitchel van Eijgen
Author URI: https://mvaneijgen.nl
License: GPL2
*/
// /* -------------------------- //
// // Create custom post type
// // -------------------------- */
// function testimonal_init() {
// // set up testimonal labels
// $labels = array(
// 'name' => 'testimonals',
// 'singular_name' => 'testimonal',
// 'add_new' => 'Add New testimonal',
// 'add_new_item' => 'Add New testimonal',
// 'edit_item' => 'Edit testimonal',
// 'new_item' => 'New testimonal',
// 'all_items' => 'All testimonals',
// 'view_item' => 'View testimonal',
// 'search_items' => 'Search testimonals',
// 'not_found' => 'No testimonals Found',
// 'not_found_in_trash' => 'No testimonals found in Trash',
// 'parent_item_colon' => '',
// 'menu_name' => 'testimonals',
// );
//
// // register post type
// $args = array(
// 'labels' => $labels,
// 'public' => true,
// 'has_archive' => true,
// 'show_ui' => true,
// 'capability_type' => 'post',
// 'hierarchical' => false,
// 'rewrite' => array('slug' => 'testimonal'),
// 'query_var' => true,
// 'menu_icon' => 'dashicons-randomize',
// 'supports' => array(
// 'title',
// 'editor',
// 'excerpt',
// 'trackbacks',
// 'custom-fields',
// 'comments',
// 'revisions',
// 'thumbnail',
// 'author',
// 'page-attributes'
// )
// );
// register_post_type( 'testimonal', $args );
//
// }
// add_action( 'init', 'testimonal_init' );
//
// /* -------------------------- //
// // Create custom taxonamy
// // -------------------------- */
// function people_init() {
// // create a new taxonomy
// register_taxonomy(
// 'people',
// array('testimonal'),
// array(
// 'label' => __( 'People' ),
// 'rewrite' => array( 'slug' => 'person' ),
// 'capabilities' => array(
// 'assign_terms' => 'edit_guides',
// 'edit_terms' => 'publish_guides'
// )
// )
// );
// }
// add_action( 'init', 'people_init' );
/* -------------------------- //
// Remove custom taxonamy
// -------------------------- */
// function ev_unregister_taxonomy(){
// register_taxonomy('testimonal_category', array());
// }
// add_action('init', 'ev_unregister_taxonomy');
/*
* Usage for a custom post type named 'movies':
* unregister_post_type( 'movies' );
*
* Usage for the built in 'post' post type:
* unregister_post_type( 'post', 'edit.php' );
*/
?>