wordpress-mobile-pack icon indicating copy to clipboard operation
wordpress-mobile-pack copied to clipboard

Pages export is empty for large number of pages

Open anghelalexandra opened this issue 9 years ago • 1 comments

Because of the 100 pages limit, pages will not be exported if almost all parent pages are deactivated, but a large number of children are still active.

This is fixed by removing the limit and excluding the parents from the query:

in get_pages_order(): $all_pages = get_pages( array( 'sort_column' => 'menu_order,post_title', 'exclude' => implode(',', $this->inactive_pages), 'exclude_tree' => implode(',', $this->inactive_pages), -> exclude inactive parent 'post_status' => 'publish', 'post_type' => 'page', // 'number' => $limit -> deactivate limit ) );

in export_pages(): $args = array( 'post__not_in' => $this->inactive_pages, 'post_parent__not_in' => $this->inactive_pages, -> exclude inactive parent 'numberposts' => $limit, 'posts_per_page' => $limit, 'post_status' => 'publish', 'post_type' => 'page', 'post_password' => '' );

anghelalexandra avatar Dec 13 '16 10:12 anghelalexandra

Partially fixed in e5e2c9c1fdc41f97bb9060943d1ea8c2dc5bfc9f, except for grandchild pages. WPQuery will only exclude direct descendants, while active grandchild pages are retrieved from the database even though they are not displayed in the final result. If too many grandchild pages are present, they will prevent following active pages from being read.

anghelalexandra avatar Dec 17 '16 17:12 anghelalexandra