Code Patch for Listing Child Pages

Here’s a code patch for anyone bothered by Role Scoper’s disobedience of the child_of parameter.  Human translation: When you are viewing a page on the front end of your site, if your theme normally narrows the sidebar pages listing down to subpages of the current page, you will instead get a list of all viewable pages. The fix for this affects several files and will be included in the next Role Scoper revision. Until then, here is a manual code patch that will work if your wp_list_pages call is passing child_of and depth=1.

In wp-content/plugins/role-scoper/hardway/hardway_rs.php, add:
if ( ! empty($child_of) && ! empty($depth) && ( 1 == $depth ) ) {
foreach ( $pages as $key => $page ) {
if ( isset($page->post_parent) && ( $child_of != $page->post_parent ) )
unset($pages[$key]);
}
}

just before:
$cache[ $ckey ] = $pages;

Thanks to Marci for the bug report.