Permalink
Browse files

Added custom permalinks and added flush to rewrite permalinks

  • Loading branch information...
1 parent c6571c1 commit f0fa8ba8fdbdae20ae677e125695cb6cf3cf8fb3 @markotom markotom committed Nov 25, 2013
Showing with 13 additions and 12 deletions.
  1. +13 −12 class-research-projects.php
@@ -206,6 +206,7 @@ private static function get_blog_ids() {
*/
private static function single_activate() {
// TODO: Define activation functionality here
+ flush_rewrite_rules();
}
/**
@@ -215,6 +216,7 @@ private static function single_activate() {
*/
private static function single_deactivate() {
// TODO: Define deactivation functionality here
+ flush_rewrite_rules();
}
/**
@@ -254,12 +256,17 @@ public function register_post_type() {
),
'description' => __('Research projects', $this->plugin_slug),
'public' => true,
- 'exclude_from_search' => true,
- 'publicy_queryable' => false,
+ 'rewrite' => array(
+ 'slug' => _x('proyectos', 'Slug URL', $this->plugin_slug),
+ 'with_front' => false
+ ),
+ 'exclude_from_search' => false,
+ 'publicy_queryable' => true,
+ 'query_var' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
- 'register_meta_box_cb' => array($this, 'register_meta_boxes'),
- 'capabilities' => array(
+ 'register_meta_box_cb' => array( $this, 'register_meta_boxes' ),
+ 'capabilities' => array(
'edit_post' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
@@ -270,12 +277,7 @@ public function register_post_type() {
),
'taxonomies' => array('research_category'),
'hierarchical' => false,
- 'supports' => array(
- 'title',
- 'editor',
- 'revisions',
- 'thumbnail'
- )
+ 'supports' => array( 'title', 'editor', 'revisions', 'thumbnail' )
)
);
}
@@ -301,12 +303,11 @@ public function register_taxonomies () {
'new_item_name' => __( 'New Category Name' ),
'menu_name' => __( 'Categories' ),
),
-
'rewrite' => array(
'slug' => 'research_category',
'with_front' => false,
'hierarchical' => true
- ),
+ )
));
}

0 comments on commit f0fa8ba

Please sign in to comment.