Check to see if any pages exist when generating page rewrite rules. Bug 345. Patch from MC_incubus.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-10-08 00:16:44 +00:00
parent d1d02a30bb
commit 943351b556

View File

@ -520,17 +520,19 @@ function generate_page_rewrite_rules() {
$posts = $wpdb->get_results("SELECT ID, post_name FROM $wpdb->posts WHERE post_status = 'static'");
$page_rewrite_rules = array();
foreach ($posts as $post) {
// URI => page name
$uri = get_page_uri($post->ID);
$page_rewrite_rules[$uri] = $post->post_name;
if ($posts) {
foreach ($posts as $post) {
// URI => page name
$uri = get_page_uri($post->ID);
$page_rewrite_rules[$uri] = $post->post_name;
}
update_option('page_uris', $page_rewrite_rules);
save_mod_rewrite_rules();
}
update_option('page_uris', $page_rewrite_rules);
save_mod_rewrite_rules();
}
function the_quicktags () {