mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-07 18:50:12 +00:00
Cache rewrite rules. Add WP_Rewrite::flush_rules(). fixes #2155
git-svn-id: https://develop.svn.wordpress.org/trunk@3373 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -171,7 +171,7 @@ $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comm
|
||||
// First Page
|
||||
|
||||
$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, to_ping, pinged, post_content_filtered) VALUES ('1', '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(__('about'))."', '$now', '$now_gmt', 'static', '', '', '')");
|
||||
generate_page_rewrite_rules();
|
||||
$wp_rewrite->flush_rules();
|
||||
|
||||
// Set up admin user
|
||||
$random_password = substr(md5(uniqid(microtime())), 0, 6);
|
||||
|
||||
@@ -76,8 +76,6 @@ if ( isset($_POST) ) {
|
||||
$permalink_structure = get_settings('permalink_structure');
|
||||
$category_base = get_settings('category_base');
|
||||
|
||||
generate_page_rewrite_rules();
|
||||
|
||||
if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
|
||||
$writable = true;
|
||||
else
|
||||
@@ -88,7 +86,7 @@ if ($wp_rewrite->using_index_permalinks())
|
||||
else
|
||||
$usingpi = false;
|
||||
|
||||
save_mod_rewrite_rules();
|
||||
$wp_rewrite->flush_rules();
|
||||
?>
|
||||
|
||||
<?php if (isset($_POST['submit'])) : ?>
|
||||
|
||||
@@ -66,7 +66,7 @@ case 'update':
|
||||
// If siteurl or home changed, reset cookies.
|
||||
if ( get_settings('siteurl') != $old_siteurl || get_settings('home') != $old_home ) {
|
||||
// If home changed, write rewrite rules to new location.
|
||||
save_mod_rewrite_rules();
|
||||
$wp_rewrite->flush_rules();
|
||||
// Get currently logged in user and password.
|
||||
get_currentuserinfo();
|
||||
// Clear cookies for old paths.
|
||||
|
||||
@@ -4,7 +4,7 @@ require_once(ABSPATH . '/wp-admin/admin-functions.php');
|
||||
require_once(ABSPATH . '/wp-admin/upgrade-schema.php');
|
||||
// Functions to be called in install and upgrade scripts
|
||||
function upgrade_all() {
|
||||
global $wp_current_db_version, $wp_db_version;
|
||||
global $wp_current_db_version, $wp_db_version, $wp_rewrite;
|
||||
$wp_current_db_version = __get_option('db_version');
|
||||
|
||||
// We are up-to-date. Nothing to do.
|
||||
@@ -33,8 +33,7 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 3308 )
|
||||
upgrade_160();
|
||||
|
||||
generate_page_rewrite_rules();
|
||||
save_mod_rewrite_rules();
|
||||
$wp_rewrite->flush_rules();
|
||||
|
||||
update_option('db_version', $wp_db_version);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user