Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pages export is empty for large number of pages #13

Open
anghelalexandra opened this issue Dec 13, 2016 · 1 comment
Open

Pages export is empty for large number of pages #13

anghelalexandra opened this issue Dec 13, 2016 · 1 comment
Labels

Comments

@anghelalexandra
Copy link
Contributor

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
Copy link
Contributor Author

anghelalexandra commented Dec 17, 2016

Partially fixed in e5e2c9c, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant