unhide_page( $pages_to_hide, $page ); } foreach ( $pages as $page_key => $page ) { $page_name = $page[4]; if ( in_array( $page_name, $pages_to_hide, true ) ) { unset( $pages[ $page_key ] ); } } return $pages; } /** * Given a list of passed pages that will be disabled, removes the given page from the list so that it will no longer be disabled. * * @param array $hidden_pages The pages to search through. * @param string $page The page to temporarily enable. * * @return array The remaining pages that need to be disabled. */ private function unhide_page( $hidden_pages, $page ) { $enable_page = array_search( $page, $hidden_pages, true ); if ( $enable_page !== false ) { unset( $hidden_pages[ $enable_page ] ); } return $hidden_pages; } }