I don’t think it’s a good approach. Themes shouldn’t change any settings and definitely not settings like permalink structure.
If I’ve set my permalinks structure to given one, then I had my reasons to do it. Such change have many effects. If you change the permalink structure you cause many SEO problems. But also – the site may stop working at all (for example if the server doesn’t support permalinks at all or if it doesn’t have access rights to .htaccess file).
So… The real question is not how to force WP to recalculate the permalinks, but who to avoid such operation at all.
If you really need a permalink structure to be set to given one, then you can politely ask user to change it using admin notice.
But to be honest, I really doubt that a theme should require such changes. It should work with any permalink structure.
Related Posts:
- Get the blog page URL set in Options
- How to set permalink structure via functions.php
- Different ways to display title
- How Do I Programmatically Force Custom Permalinks with My Theme?
- Link won’t show using the_permalink();
- get_query_var() and permalinks
- WordPress 404 page returning with default in IIS7
- WordPress custom post type permalink: website.com/post-name/post-id
- Filter categories used with Custom Structure Permalink
- How to make permalinks update from code?
- How to set a page as homepage in stead of the newspages?
- wordpress 404 not found after rewrtie the author link
- Issue On Displaying Pages with Post Name Permalink
- Issue on Getting Custom post type Thumbnail’s URL
- WordPress page/blog incorporated into static website
- Only the latest post shows up on post page?
- How to remove permalinks links presents in each page of my site?
- If I remove Category base from my URLs, how difficult will rollback be?
- What are the permalinks options for “Category” base and removing it?
- How do I open a post in a custom page in wordpress?
- Does single webpage do not need navigation to create a slug in permalink?
- Getting post URL within custom content template
- Mamp pro permalink issues. Pages keep reverting to index.php
- Permalinks problem with custom theme
- Permalink Setting Changes From Post Name to Default After Changing The Page Name
- Configuring static page with add_rewrite_rule gives 404 after navigating to Permalinks admin panel
- How to detect mobile devices and present them a specific theme?
- Using wp_add_inline_style without a stylesheet
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- Bestway To Define Theme and Plugin path and url
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- WordPress twentytwenty theme inline css overriding css body
- What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?
- How can I insert default widgets when my theme is activated (similar to what twenty eleven does)?
- date_i18n() issue
- Active theme responds to theme change request to alert user
- LOST in WP Template Hireachy
- Should use widgets in this case?
- Changing the entire control choices using wp.customize with JavaScript
- Static Front Page problem
- Enabling Default Widgets in a Custom Theme
- get_post() function returns post even if it is trashed
- There’s an image named g.gif somewhere in my WordPress site
- How to regenerate thumbnails when they’re stored on S3
- customizing the_password_form filter
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- searchform.php override not working
- Can’t show custom post thumbnail sizes as background images
- Load child template based on parent
- How to make the_tags title translatable?
- Should I use include or load_template for including shortcodes, plugins and so on?
- Set default featured image for terms of a custom taxonomy
- How to add material design css in wordpress and woocommerce
- Timber: Get single image from media library with all attributes
- page.php dependent sites are not working in custom woocommerce theme
- Code to determine WP version check
- “Theme without sidebar.php is deprecated”
- Is it acceptable for a WordPress theme to not accept widgets?
- get_term_link is Ending to single.php
- wp e-commerce – theme problem – why won’t it load wpsc-single_product.php? [closed]
- Extending Twenty Eleven Theme
- my excerpts lack the ‘more’ link
- Simple child theme modification but links are broken
- how to retrieve the image title for image Post Format
- Iris color picker in custom theme option page not saving value
- Is functions.php in themes applied to all templates?
- Want to add cart and a search bar in the right of logo line
- how do i develop a global nav and local nav to be wordpress dynamic?
- Why Tags don’t appear in my page?
- First post full width without Sidebar
- How to make a theme unable to be used on a multisite network?
- Default PHP document / names needed for a WordPress theme?
- How to determine when my theme is deactivated?
- 1 post per category on homepage and counting those posts
- if (has_custom_menu())?
- Exclude parent categories from the_category() within the loop
- Ensure SQL changes carry over
- only the first post is shown
- wordpress can’t find single-project page
- How can I set multi archive page template on same time for only one custom post type?
- Show Yoast SEO meta tags in Custom WordPress Templates (Theme)
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- How to show some of category in wordpress
- using themename_the_custom_logo() in template-tags?
- How to make the media library searchable by image title
- WordPress doesn’t load css, image and js files after moving local installation folder
- Custom page template not showing on page creation
- How to get url image page the right way?
- Undefined index: custom_sidebars
- How To Customise WordPress Comment Submit Button?
- Next/Previous post navigation
- page.php is not called when I load a Page
- Single Featured Image Repeating
- Main Menu Theme Different Output Print
- How can I install my custom-made theme on a wordpress.com blog? [closed]
- IS there any reason not to include javascript in my own post’s embeds?
- How to create more templates to the same theme?
- A problem in loading index.php
- .submenu class missing in output from wp_nav_menu
- How to send async emails in wordpress?