Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing private page list
  • Loading branch information
Roy committed Mar 3, 2017
1 parent 4c12ae2 commit 4e5e494
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions page-private.php
Expand Up @@ -14,36 +14,36 @@ get_header(); ?>
<div id="primary" class="content-area subpage">
<main id="main" class="site-main" role="main">
<?php get_template_part( 'content', 'page' ); ?>

<?php
$sort = array();
$pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'child_of' => get_the_ID()));
if(count($pages) > 0){
foreach($pages as $key => $page){
$sort[$key] = $page->post_title;
}
asort($sort);
echo '<ul>';
foreach( $sort as $key => $title ){
$pg = $pages[$key];
$parent = is_parent_private($pg->ID);
if($parent !== false) $page = $parent;
else $page = $pg->ID;
$private = get_post_meta($page, 'uc-private', true);
if(!($private == 'admins' || $private == 'users' || $private == 'list' || $private == 'netids')){
continue;
}
$title = ucwords($pg->post_title);
echo '<li><a href="'.get_page_link($pg->ID).'" class="az-letter-page">'.$title.'</a></li>';

}
echo '</ul>';
}
?>
</main>
</div>

<?php
$sort = array();
$pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'child_of' => get_the_ID()));
if(count($pages) > 0){
foreach($pages as $key => $page){
$sort[$key] = $page->post_title;
}
asort($sort);
echo '<ul>';
foreach( $sort as $key => $title ){
$pg = $pages[$key];
$parent = is_parent_private($pg->ID);
if($parent !== false) $page = $parent;
else $page = $pg->ID;
$private = get_post_meta($page, 'uc-private', true);
if(!($private == 'admins' || $private == 'users' || $private == 'list' || $private == 'netids')){
continue;
}
$title = ucwords($pg->post_title);
echo '<li><a href="'.get_page_link($pg->ID).'" class="az-letter-page">'.$title.'</a></li>';

}
echo '</ul>';
}
?>

</div>
</div>
<?php include('inc/sidebar-if-active.php')?>
</div>
<?php endwhile; // end of the loop. ?>
Expand Down

0 comments on commit 4e5e494

Please sign in to comment.