WordPress.org

Ready to get started?Download WordPress

Forums

The wp_list_pages() function does not display private pages (7 posts)

  1. Yves
    Member
    Posted 6 years ago #

    Hi

    It seems that as soon as you mark a page as "private" it disappears from the wp_list_pages() output even though I am logged in as the admin and created the page in question with the same account. I tried it on a fresh WordPress 2.2.1 install with the default theme and it confirms my finding.
    I do not believe this should be the correct behaviour as the post behave as expected.

    I did try the many different access restriction plugins out there but they either do not work well with WordPress 2.2.1, or conflict with other plugins (Event Calendar 3 or ical4wp for instance)

    I could not find a trace of this behaviour anywhere in the forums or in the bug database. Can anyone replicate my finding? As anyone found a workaround? I certainly could hard code the link to the pages but the function is really much more elegant and flexible and using the private pages is the best solution for my purpose and insure the best forward compatibility.

    Regards

    Yves

  2. Yves
    Member
    Posted 6 years ago #

    Update :

    Related to an issue raised here 5 months ago with wordpres 2.1

  3. astronaute
    Member
    Posted 6 years ago #

    I have same problem, why private pages are invisible ?

    Thank you for your responses.

    Best regards,

  4. ccoupe
    Member
    Posted 6 years ago #

    Anyone look at wp_list_pages() doc? Perhaps there's on option you can add to display "private" on the admin pages but not the front page.

  5. Yves
    Member
    Posted 6 years ago #

    I did, and quite extensively.
    The Documentation page on wp_list_pages() is quite clear and states amongst other points:

    By default, the usage shows:

    * All Pages and sub-pages are displayed (no depth restriction)
    * Is not restricted to the child_of any Page
    * No pages are excluded
    * Is not restricted to any specific author
    * Includes all Pages
    * Not restricted to Pages with specific meta key/meta value

    Yet the private pages do not appear even when logged as admin.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    This is a general problem with get_pages and get_posts and there's no simple fix for it yet. Sorry.

  7. urswurve
    Member
    Posted 6 years ago #

    Is there any update on this?

    I swear it worked momentarily then I changed something and it doesn't work anymore.

    It's a real pain in the ass because I'm developing this blog for a customer who wants to restrict access to specific pages based on authentication.

    Is there any other functions or work arounds for this?

Topic Closed

This topic has been closed to new replies.

About this Topic