If you ever noticed that your private pages not listed by your WordPress theme after you are logged in?
Only published pages are listed. Also if you are logged in - your private pages are not listed!
Why not? Whats happens?
Your theme or your widget uses the wp_list_pages() function to list your pages. This function calls another function (get_pages) to retrieve the list from your database.
Also if you have the right capability “read_private_pages”, private pages are not listed. Neither your nor the private pages of your other users.
Note: The screenshot in the right is from my Role Manager Plugin.
The reason: get_pages() and therefore wp_list_pages() looks for pages only with the database-status “publish” as the attribute for public published pages.
Would not it be nice if the private pages appear in the list?
After some tests yesterday I wrote a patch to get a new option for wp_list_pages() and get_pages(). The default value in my patch is that private pages are included into the list if the user has the capability “read_private_pages”. With the new option you can switch off including private pages for those users. A small example with switched off private pages:
wp_list_pages('title_li=<h2>Pages</h2>&include_private_pages=0');
For users who are logged out or don’t have the capability “read_private_pages” nothing is changed - they see only your public pages.
If you like this feature and want see it in the core of WordPress, please vote for it at the trac ticket I opened.

am 11.06.2008 um 17:53 Uhr:
Hallo,
erstmal danke für das klasse plugin! Leider kriege ich es mit der aktuellen WP Version (2.5.1) nicht zum laufen. Allerdings benutze ich zusätzlich auch noch das plugin wswwpx_fold_page_list() um die Sidbar zu gruppieren. Sollte die Ansicht der privaten Seiten damit auch funktionieren? Danke schon mal für die Bemühungen und liebe Grüße
uTZFu
am 10.11.2008 um 15:53 Uhr:
Vielen Dank für den Patch
Funktioniert einwandfrei mit Wordpress 2.6.3 unter http://www.kjg-bilfingen.de/. Ich denke, ich werde den Patch auch bei meinem privaten Blog verwenden.
Grüße, adi
am 02.12.2008 um 12:25 Uhr:
Noch ein Klasse Patch von Dir! Danke sehr - werd ich gleich mal ausprobieren!
am 02.12.2008 um 15:04 Uhr:
Genau dieses Plugin hat mir noch gefehlt. Das wird demnächst eingebaut für QM und Usability Optimierung. Mein Author wird sich freuen
am 25.06.2009 um 07:41 Uhr:
Hey danke super patch =)
am 30.08.2009 um 00:56 Uhr:
Dieses Plugin habe ich lange gesucht und endlich gefunden Das werde ich gleich einbauenfür und auch alles dafür optimieren. Das wird mir ne menge Sache erleichtern. Vorallem beim texte verfassen.
am 14.09.2009 um 13:36 Uhr:
Hallo. Wo kann man denn den Patch downloaden bzw. wo steht der Code für den Patch? Ich finde das irgendwie nicht auf dieser Seite. Oder bin ich blind?!
Viele Grüße
Dyscalcolon
am 14.09.2009 um 13:39 Uhr:
Okay sorry. Hab den Link zum trac ticket gefunden. Kann man das in Form eines Plugins realisieren, sodass man nicht den Core verändern muss?
VG