Renaming stuff
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Dec 2017 19:39:16 +0000 (14:39 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Dec 2017 19:39:16 +0000 (14:39 -0500)
Renaming stuff in the new function.

functions.php

index 5634d44..3b19e1b 100644 (file)
@@ -98,27 +98,24 @@ add_filter('pre_get_posts','SearchFilter');
 
 function glm_get_notvisable_page_ids()
 {
-    static $publishPageIds = array();
-    //return implode( ',', $publishPageIds );
-    if ( empty( $publishPageIds ) ) {
+    static $badPageIds = array();
+    if ( empty( $badPageIds ) ) {
         // Find all pages marked published
-        $publishedPages = get_pages(
+        $notPublishedPages = get_pages(
             array(
                 'post_type'   => 'page',
                 'post_status' => 'publish',
             )
         );
-    if ( $publishedPages ) {
-            foreach ( $publishedPages as $page ) {
+        if ( $notPublishedPages ) {
+            foreach ( $notPublishedPages as $page ) {
                 if ( $page->post_password ) {
-                    $publishPageIds[] = $page->ID;
+                    $badPageIds[] = $page->ID;
                 }
             }
         }
-        return implode( ',', $publishPageIds );
-    } else {
-    return '';
     }
+    return implode( ',', $badPageIds );
 }
 
 /**