Make sure rewrites are added to .htaccess immediately after activation
This commit is contained in:
@@ -38,8 +38,7 @@ function roots_theme_activation_options_add_page() {
|
||||
);
|
||||
} else {
|
||||
if (is_admin() && isset($_GET['page']) && $_GET['page'] === 'theme_activation_options') {
|
||||
global $wp_rewrite;
|
||||
$wp_rewrite->flush_rules();
|
||||
flush_rewrite_rules();
|
||||
wp_redirect(admin_url('themes.php'));
|
||||
exit;
|
||||
}
|
||||
@@ -217,14 +216,12 @@ function roots_theme_activation_action() {
|
||||
|
||||
if ($roots_theme_activation_options['change_permalink_structure']) {
|
||||
$roots_theme_activation_options['change_permalink_structure'] = false;
|
||||
global $wp_rewrite;
|
||||
|
||||
if (get_option('permalink_structure') !== '/%postname%/') {
|
||||
global $wp_rewrite;
|
||||
$wp_rewrite->set_permalink_structure('/%postname%/');
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
|
||||
$wp_rewrite->init();
|
||||
$wp_rewrite->flush_rules();
|
||||
}
|
||||
|
||||
if ($roots_theme_activation_options['change_uploads_folder']) {
|
||||
|
||||
Reference in New Issue
Block a user