From 2da1bd4d3765308cdd474906d650387c15c99f08 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 20 Dec 2017 14:39:16 -0500 Subject: [PATCH] Renaming stuff Renaming stuff in the new function. --- functions.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index 5634d44..3b19e1b 100644 --- a/functions.php +++ b/functions.php @@ -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 ); } /** -- 2.17.1