diff --git a/content-az.php b/content-az.php index 62a82f7..2d3bf4e 100644 --- a/content-az.php +++ b/content-az.php @@ -1,83 +1,97 @@ -.<]#'; -?> - - -
> -
- ', '' ); ?> -
- -
- - '', - ) ); - ?> -
- -
- post_title); - $char = $title{0}; - if( !(is_numeric($char)) && !in_array($char, $letters) ){ - array_push($letters, $char); - } - } - return $letters; - } - - // Generate AZ Navigation - echo ''; - - // Generate AZ List - $pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'exclude' => $exclude)); - if( !preg_match($pattern, $exclude, $matches) ){ - $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 '

'.$char.'

    '; - array_push($letters, $char); - } - echo '
  1. '.$title.'
  2. '; - } - } - echo '
'; - } else { - echo '

Invalid input in field: "exclude"

'; - } - ?> - - -
+.<]#'; +?> + + +
> +
+ ', '' ); ?> +
+ +
+ + '', + ) ); + ?> +
+ +
+ 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; + } + + // Generate AZ Navigation + echo ''; + + // Generate AZ List + $pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'exclude' => $exclude)); + if( !preg_match($pattern, $exclude, $matches) ){ + $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 '

'.$char.'

    '; + array_push($letters, $char); + } + echo '
  1. '.$title.'
  2. '; + } + } + echo '
'; + } else { + echo '

Invalid input in field: "exclude"

'; + } + ?> + + +
diff --git a/inc/nav-walker.php b/inc/nav-walker.php index 9135f45..599580f 100644 --- a/inc/nav-walker.php +++ b/inc/nav-walker.php @@ -1,358 +1,374 @@ - - * - * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu". - * So basically add one to what you'd expect it to be - */ - function start_lvl(&$output, $depth, $args) - { - if(isset($args->with_search) && $args->with_search == true){ - add_filter('wp_nav_menu_items', 'search_menu_item', 1, 2); - } - - $tabs = str_repeat("\t", $depth); - // If we are about to start the first submenu, we need to give it a dropdown-menu class - if ($depth >= 0) { //really, level-1 or level-2, because $depth is misleading here (see note above) - $output .= "\n{$tabs}