Ticket #6939 (new defect)

Opened 2 months ago

Last modified 1 month ago

wp_list_pages() should also lists private pages if the user has capability 'read_private_pages'

Reported by: imwebgefunden Assigned to: anonymous
Priority: normal Milestone: 2.5.2
Component: Template Version: 2.5.1
Severity: normal Keywords: wp_list_pages, read_private_pages
Cc:

Description

If the user has the capability "read_private_pages" wp_list_pages() don't lists private pages in no way. I've noticed this problem by some comments on my "Role Manager" Plugin page.

Two patches are attached to this ticket.

wp_list_pages() gets a new option "include_private_pages". The default value is 1 for lists private pages too if the user has the capability "read_private_pages". If private pages should not be listed also if the user has the cap "read_private_pages" the syntax is as an example: wp_list_pages('title_li=<h2>Pages</h2>&include_private_pages=0');

The second patch is for get_pages() - with the same option and default value.

And of course: if a user don't has the cap "read_private_pages" private pages are listed in no case :)

Attachments

post-template.diff (488 bytes) - added by imwebgefunden on 05/08/08 18:24:51.
Patch for wp-includes/post-template.php
post.diff (1.2 kB) - added by imwebgefunden on 05/08/08 18:25:29.
Patch for wp-includes/post.php

Change History

05/08/08 18:24:51 changed by imwebgefunden

  • attachment post-template.diff added.

Patch for wp-includes/post-template.php

05/08/08 18:25:29 changed by imwebgefunden

  • attachment post.diff added.

Patch for wp-includes/post.php

06/05/08 18:10:29 changed by chodo

This is a very useful patch! I think it should be included in Wordpress. Works like a charm for me.