-
Notifications
You must be signed in to change notification settings - Fork 0
/
myfaq.php
43 lines (37 loc) · 932 Bytes
/
myfaq.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
<?php
/**
* Plugin Name: FAQs
* Description: This plugin adds some FAQs.
* Author Name: Avneet
*/
add_action( 'init', 'create_plugin_post_type');
function create_plugin_post_type() {
register_post_type(
'questions', // CPT
array(
'labels' => array(
'name' => __( 'Questions' ),
'singular_name' => __( 'Question' )
),
'public' => true,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields',
'comments' )
)
);
register_taxonomy(
'faq', //taxonomy
'questions', //CPT
array(
'label' => __( 'FAQs', 'taxonomy general name' ),
'labels' => array(
'name' => _x( 'FAQs', 'taxonomy general name' ),
'singular_name' => _x( 'FAQ' , 'taxonomy singular name' )
),
'rewrite' => array( 'slug' => 'faq' ),
'hierarchical' => true,
)
);
}
include_once("shortcode.php");
?>