File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 $ home_path = ABSPATH ;
2121}
2222
23- if (isset ($ _POST ['submit ' ])) {
24- $ permalink_structure = preg_replace ('#/+/# ' , '/ ' , $ _POST ['permalink_structure ' ]);
23+ if ( isset ($ _POST ) ) {
24+ if ( $ _POST ['permalink_structure ' ] )
25+ $ permalink_structure = preg_replace ('#/+# ' , '/ ' , '/ ' . $ _POST ['permalink_structure ' ]);
26+ else
27+ $ permalink_structure = $ _POST ['permalink_structure ' ];
28+
29+ if ( $ _POST ['category_base ' ] )
30+ $ category_base = preg_replace ('#/+# ' , '/ ' , '/ ' . $ _POST ['category_base ' ]);
31+ else
32+ $ category_base = $ _POST ['category_base ' ];
33+
2534 update_option ('permalink_structure ' , $ permalink_structure );
26-
27- update_option ('category_base ' , $ _POST ['category_base ' ]);
28- $ category_base = $ _POST ['category_base ' ];
29- } else {
30- $ permalink_structure = get_settings ('permalink_structure ' );
31- $ category_base = get_settings ('category_base ' );
35+ update_option ('category_base ' , $ category_base );
3236}
3337
38+ $ permalink_structure = get_settings ('permalink_structure ' );
39+ $ category_base = get_settings ('category_base ' );
40+
41+
3442generate_page_rewrite_rules ();
3543
3644if ( (!file_exists ($ home_path .'.htaccess ' ) && is_writable ($ home_path )) || is_writable ($ home_path .'.htaccess ' ) )
You can’t perform that action at this time.
0 commit comments