diff --git a/src/classes/repositories/class-tainacan-collections.php b/src/classes/repositories/class-tainacan-collections.php index a62c0a4cd..5e8df8d22 100644 --- a/src/classes/repositories/class-tainacan-collections.php +++ b/src/classes/repositories/class-tainacan-collections.php @@ -245,7 +245,8 @@ class Collections extends Repository { 'has_archive' => true, 'query_var' => 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(), 'map_meta_cap' => true, 'supports' => [ diff --git a/src/migrations.php b/src/migrations.php index d3543406c..7467d4e69 100644 --- a/src/migrations.php +++ b/src/migrations.php @@ -273,6 +273,11 @@ class Migrations { } } + + static function refresh_rewrite_rules() { + // needed after we changed the Collections post type rewrite slug + flush_rewrite_rules(false); + } }