From 70da853d29562e4a5dd37d914eff1e991ab2f0e8 Mon Sep 17 00:00:00 2001 From: Joshua Roy Date: Mon, 12 Jan 2015 15:17:18 -0500 Subject: [PATCH] Update to hale to hide private pages and adding list private pages template --- page-az.php | 166 ++++++++++++++++++++++++++++------------------------ 1 file changed, 90 insertions(+), 76 deletions(-) diff --git a/page-az.php b/page-az.php index 2d3e7cc..c7c50da 100644 --- a/page-az.php +++ b/page-az.php @@ -1,76 +1,90 @@ - - - -
-
-
-
- -
-

- -

-
- -
-
- post_title); - $char = $title{0}; - if( !(is_numeric($char)) && !in_array($char, $letters) ){ - array_push($letters, $char); - } - } - return $letters; - } - - echo '
    '; - $anchors = getChars(); - foreach( range('A', 'Z') as $char ){ - if( in_array( $char, $anchors ) ){ - echo '
  • '.$char.'
  • '; - } else { - echo '
  • '.$char.'
  • '; - } - } - echo '
'; - - - $pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false)); - $letters = array(); - echo '
    '; - foreach( (array) $pages as $pg ){ - $title = ucwords($pg->post_title); - $char = $title{0}; - if( !( is_numeric($char) || empty($char) ) ){ - if( $char != end($letters) && !empty($letters) ){ - echo '
'; - } - if( !in_array($char, $letters) ){ - echo ' -
- -
- -
-
- - + + + +
+
+
+
+ +
+

+ +

+
+ +
+
+ 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'){ + continue; + } + $title = ucwords($pg->post_title); + $char = $title{0}; + if( !(is_numeric($char)) && !in_array($char, $letters) ){ + array_push($letters, $char); + } + } + return $letters; + } + + echo '
    '; + $anchors = getChars(); + foreach( range('A', 'Z') as $char ){ + if( in_array( $char, $anchors ) ){ + echo '
  • '.$char.'
  • '; + } else { + echo '
  • '.$char.'
  • '; + } + } + echo '
'; + + + $pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false)); + $letters = array(); + echo '
    '; + foreach( (array) $pages as $pg ){ + $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'){ + continue; + } + $title = ucwords($pg->post_title); + $char = $title{0}; + if( !( is_numeric($char) || empty($char) ) ){ + if( $char != end($letters) && !empty($letters) ){ + echo '
'; + } + if( !in_array($char, $letters) ){ + echo ' +
+ +
+ +
+
+ +