change collections rewrite slug

This commit is contained in:
Leo Germani 2018-08-27 18:24:04 -03:00
parent 8f417e5c69
commit 19e3b790c6
2 changed files with 7 additions and 1 deletions

View File

@ -245,7 +245,8 @@ class Collections extends Repository {
'has_archive' => true, 'has_archive' => true,
'query_var' => true, 'query_var' => true,
'can_export' => true, 'can_export' => true,
'rewrite' => true, /* Translators: The Collections slug - will be the URL for the collections archive */
'rewrite' => ['slug' => sanitize_title(_x('collections', 'Slug: the string that will be used to build the URL', 'tainacan'))],
'capability_type' => Entities\Collection::get_capability_type(), 'capability_type' => Entities\Collection::get_capability_type(),
'map_meta_cap' => true, 'map_meta_cap' => true,
'supports' => [ 'supports' => [

View File

@ -274,6 +274,11 @@ class Migrations {
} }
} }
static function refresh_rewrite_rules() {
// needed after we changed the Collections post type rewrite slug
flush_rewrite_rules(false);
}
} }