From 19e3b790c6c7e0322b3710d1b21d5779597ef978 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Mon, 27 Aug 2018 18:24:04 -0300 Subject: [PATCH] change collections rewrite slug --- src/classes/repositories/class-tainacan-collections.php | 3 ++- src/migrations.php | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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); + } }