示例#1
0
 public static function create_post_type()
 {
     self::$cpt = new BuggyPress_Post_Type(self::POST_TYPE);
     self::$cpt->set_post_type_label(__('Issue', 'buggypress'), __('Issues', 'buggypress'));
     self::$cpt->slug = _x('issues', 'post type slug', 'buggypress');
     self::$cpt->add_support(array('comments', 'revisions'));
     self::register_taxonomies();
     self::register_meta_boxes();
     self::$cpt->capability_type = 'issue';
     self::$cpt->map_meta_cap = TRUE;
     self::$cpt->capabilities = array('read' => 'read_issues');
     $permitter = BuggyPress_Permissions::get_instance();
     $permitter->add_permissions('issues', 'administrator');
     $permitter->add_permissions('issues', 'editor');
 }
 public static function create_post_type()
 {
     self::$cpt = new BuggyPress_Post_Type(self::POST_TYPE);
     self::$cpt->set_post_type_label(__('Project', 'buggypress'), __('Projects', 'buggypress'));
     self::$cpt->slug = _x('projects', 'post type slug', 'buggypress');
     self::$cpt->remove_support(array('author'));
     self::$cpt->hierarchical = TRUE;
     self::register_taxonomies();
     self::register_meta_boxes();
     self::$cpt->capability_type = 'project';
     self::$cpt->map_meta_cap = TRUE;
     self::$cpt->capabilities = array('read' => 'read_projects');
     $permitter = BuggyPress_Permissions::get_instance();
     $permitter->add_permissions('projects', 'administrator');
     $permitter->add_permissions('projects', 'editor');
 }