/** * Display the Settings Page */ public function settingsPage() { $this->setMenu(); include NP_Helpers::view('settings'); }
<div class="nestedpages"> <?php $this->loopPages(); ?> <div class="quick-edit quick-edit-form" style="display:none;"> <?php include NP_Helpers::view('quickedit'); ?> </div> <?php if (current_user_can('publish_pages')) { ?> <div class="quick-edit quick-edit-form-redirect" style="display:none;"> <?php include NP_Helpers::view('quickedit-redirect'); ?> </div> <?php } ?> </div> </div><!-- .wrap --> <?php include NP_Helpers::view('link-form');
/** * Loop through all the pages and create the nested / sortable list * Recursive Method, called in page.php view */ private function loopPages($parent_id = 0, $count = 0) { $this->setTaxonomies(); $pages = new WP_Query(array('post_type' => array('page', 'np-redirect'), 'posts_per_page' => -1, 'orderby' => 'menu_order', 'post_status' => array('publish', 'pending', 'draft', 'private', 'future', 'trash'), 'post_parent' => $parent_id, 'order' => 'ASC')); if ($pages->have_posts()) { $count++; if ($this->publishCount($pages) > 1) { $this->listOpening($pages, $count); } while ($pages->have_posts()) { $pages->the_post(); global $post; $this->setPostData($post); if (get_post_status(get_the_id()) !== 'trash') { echo '<li id="menuItem_' . get_the_id() . '" class="page-row'; // Published? if ($post->post_status == 'publish') { echo ' published'; } // Hidden in Nested Pages? if ($this->post_data['np_status'] == 'hide') { echo ' np-hide'; } // Taxonomies echo ' ' . $this->hierarchicalTaxonomies(get_the_id()); echo ' ' . $this->flatTaxonomies(get_the_id()); echo '">'; $count++; if (get_post_type() == 'page') { include NP_Helpers::view('row'); } else { include NP_Helpers::view('row-redirect'); } } // trash status $this->loopPages(get_the_id(), $count); if (get_post_status(get_the_id()) !== 'trash') { echo '</li>'; } } // Loop if ($this->publishCount($pages) > 1) { echo '</ol>'; } } wp_reset_postdata(); }