mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-24 15:24:36 +00:00
Move rewrite and permalink functions into WP_Rewrite class.
git-svn-id: https://develop.svn.wordpress.org/trunk@1908 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -21,22 +21,20 @@ if ( isset($_POST) ) {
|
||||
$permalink_structure = $_POST['permalink_structure'];
|
||||
if (! empty($permalink_structure) )
|
||||
$permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']);
|
||||
update_option('permalink_structure', $permalink_structure);
|
||||
$wp_rewrite->set_permalink_structure($permalink_structure);
|
||||
}
|
||||
|
||||
if ( isset($_POST['category_base']) ) {
|
||||
$category_base = $_POST['category_base'];
|
||||
if (! empty($category_base) )
|
||||
$category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
|
||||
update_option('category_base', $category_base);
|
||||
$wp_rewrite->set_category_base($category_base);
|
||||
}
|
||||
}
|
||||
|
||||
$permalink_structure = get_settings('permalink_structure');
|
||||
$category_base = get_settings('category_base');
|
||||
|
||||
get_date_permastruct();
|
||||
|
||||
generate_page_rewrite_rules();
|
||||
|
||||
if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
|
||||
@@ -44,7 +42,7 @@ if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_wri
|
||||
else
|
||||
$writable = false;
|
||||
|
||||
if ( strstr($permalink_structure, 'index.php') ) // If they're using
|
||||
if ($wp_rewrite->using_index_permalinks())
|
||||
$usingpi = true;
|
||||
else
|
||||
$usingpi = false;
|
||||
@@ -106,7 +104,7 @@ save_mod_rewrite_rules();
|
||||
<p><?php _e('If your <code>.htaccess</code> was <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a> we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
|
||||
<form action="options-permalink.php" method="post">
|
||||
<p>
|
||||
<textarea rows="5" style="width: 98%;" name="rules"><?php echo mod_rewrite_rules($permalink_structure); ?>
|
||||
<textarea rows="5" style="width: 98%;" name="rules"><?php echo $wp_rewrite->mod_rewrite_rules(); ?>
|
||||
</textarea>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user