mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
d1d02a30bb
commit
943351b556
@ -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