]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/rewrite.php
Wordpress 3.2.1
[autoinstalls/wordpress.git] / wp-includes / rewrite.php
index 839d2aeefc95997d36461c6ca8263e9cf2376daa..46c1b3219f4b43e9dde387809be1b38695f68248 100644 (file)
@@ -767,7 +767,7 @@ class WP_Rewrite {
                global $wpdb;
 
                //get pages in order of hierarchy, i.e. children after parents
-               $posts = get_page_hierarchy($wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page'"));
+               $posts = get_page_hierarchy( $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page' AND post_status != 'auto-draft'") );
 
                // If we have no pages get out quick
                if ( !$posts )
@@ -1857,6 +1857,8 @@ class WP_Rewrite {
        function add_permastruct($name, $struct, $with_front = true, $ep_mask = EP_NONE) {
                if ( $with_front )
                        $struct = $this->front . $struct;
+               else
+                       $struct = $this->root . $struct;
                $this->extra_permastructs[$name] = array($struct, $ep_mask);
        }
 
@@ -1974,14 +1976,14 @@ class WP_Rewrite {
        }
 
        /**
-        * PHP4 Constructor - Calls init(), which runs setup.
+        * Constructor - Calls init(), which runs setup.
         *
         * @since 1.5.0
         * @access public
         *
         * @return WP_Rewrite
         */
-       function WP_Rewrite() {
+       function __construct() {
                $this->init();
        }
 }