If you need to update/re-save the permalink structure from within your plugin, here’s how:
<?php global $wp_rewrite; $wp_rewrite->set_permalink_structure( get_option( 'permalink_structure' ) ); $wp_rewrite->flush_rules(); ?>
If you need to update/re-save the permalink structure from within your plugin, here’s how:
<?php global $wp_rewrite; $wp_rewrite->set_permalink_structure( get_option( 'permalink_structure' ) ); $wp_rewrite->flush_rules(); ?>
Is it possible to find the current setting before updating, so as to not have it hardcoded?
Of course (probably should have done that from the start…). Just use
get_option( 'permalink_structure' )
in place of the hard-coded structure