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
| $plugin_dir = basename(dirname(__FILE__));
$lang_dir = realpath($plugin_dir . DIRECTORY_SEPARATOR . "lang");
load_plugin_textdomain( 'pj-movies', false, $lang_dir );
// Register Post Type
$args = array(
'label' => _x("Movies", "label", "pj-movies"),
'labels' => array(
'add_new_item' => _x("Add New Movie Review", "add_new_item", "pj-movies"),
'edit_item' => _x("Edit Movie Review", "edit_item", "pj-movies"),
'new_item' => _x("New Movie Review", "new_item", "pj-movies"),
'view_item' => _x("View Movie Review", "view_item", "pj-movies"),
'search_items' => _x("Search Movie Reviews", "search_items", "pj-movies"),
'not_found' => _x("No Movie Reviews Found", "not_found", "pj-movies"),
'not_found_in_trash' => _x("No Movie Reviews found in Trash", "not_found_in_trash", "pj-movies")
),
'singular_label' => _x("Movie", "singular_label", "pj-movies"),
'public' => true,
'show_ui' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'rewrite' => array("slug" => "movies"),
'supports' => array('title', 'excerpt', 'editor', 'thumbnail', 'comments', 'revisions')
);
register_post_type( 'movie' , $args );
$this->register_post_type_archives('movie', 'movies');
register_taxonomy(
'movie_categories',
'movie',
array(
'hierarchical' => true,
'label' => _x('Categories', 'taxonomy label', "pj-movies"),
'query_var' => true,
'rewrite' => array('slug' => 'movie-categories', 'hierarchical' => true)
)
); |
Recent Comments
“Man, this may seem an old thread but it saved me! Thanks a lot bro, you're definitely a genius! ”
“Worked for me in latest Chrome, IE9-10... I might investigate it later. ”
“The video's not working on my side. ”