Check to see if any pages exist when generating page rewrite rules. Bug 345. Patch from MC_incubus.
git-svn-id: https://develop.svn.wordpress.org/trunk@1758 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7f31cf1410
commit
76209b90d2
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user