← All changes
|
src/integrations/watchers/indexable-category-permalink-watcher.php
+3
-0
19.0
→
trunk
View file →
| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Yoast\WP\SEO\Integrations\Watchers; |
| 4 | 4 | |
| 5 | +use WPSEO_Utils; | |
| 5 | 6 | use Yoast\WP\SEO\Config\Indexing_Reasons; |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * Watches the stripcategorybase key in wpseo_titles, in order to clear the permalink of the category indexables. |
| @@ -47,7 +48,9 @@ | ||
| 47 | 48 | |
| 48 | 49 | // If a new value has been set for 'stripcategorybase', clear the category permalinks. |
| 49 | 50 | if ( $old_value['stripcategorybase'] !== $new_value['stripcategorybase'] ) { |
| 50 | 51 | $this->indexable_helper->reset_permalink_indexables( 'term', 'category', Indexing_Reasons::REASON_CATEGORY_BASE_PREFIX ); |
| 52 | + // Clear the rewrites, so the new permalink structure is used. | |
| 53 | + WPSEO_Utils::clear_rewrites(); | |
| 51 | 54 | } |
| 52 | 55 | } |
| 53 | 56 | } |