/**
  * Creates the help pages and help submenu pages.
  * Returns post id of the newly created parent help page, 0 on failure.
  */
 function createHelpPages()
 {
     // don't do anything if it already exists
     $help_page = get_page_by_path('help');
     if ($help_page != null) {
         return $help_page->ID;
     }
     $hp = new HelpPage();
     $help_id = $this->createReadOnlyPage('help', 'Help', $hp->toHtml('help'), 0, 100);
     // on previous success, create help sub-pages
     if ($help_id > 0) {
         $pages_id = $this->createReadOnlyPage('pages', 'Pages', $hp->toHtml('pages'), $help_id, 10);
         // create individual help pages
         if ($pages_id > 0) {
             $post_id = $this->createReadOnlyPage('add-edit-booking', 'Add/Edit Booking', $hp->toHtml('add-edit-booking'), $pages_id, 10);
             $post_id = $this->createReadOnlyPage('allocations', 'Allocations', $hp->toHtml('allocations'), $pages_id, 20);
             $post_id = $this->createReadOnlyPage('bookings', 'Bookings', $hp->toHtml('bookings'), $pages_id, 30);
             $post_id = $this->createReadOnlyPage('daily-summary', 'Daily Summary', $hp->toHtml('daily-summary'), $pages_id, 40);
             $post_id = $this->createReadOnlyPage('resources', 'Resources', $hp->toHtml('resources'), $pages_id, 50);
         }
         $faq_id = $this->createReadOnlyPage('faq', 'FAQ', $hp->toHtml('faq'), $help_id, 20);
         // create individual FAQ pages
         if ($faq_id > 0) {
             $post_id = $this->createReadOnlyPage('how-do-i-add-a-new-booking', 'How do I add a new booking?', $hp->toHtml('how-do-i-add-a-new-booking'), $faq_id, 10);
             $post_id = $this->createReadOnlyPage('how-do-i-check-in-a-guest', 'How do I check-in a guest?', $hp->toHtml('how-do-i-check-in-a-guest'), $faq_id, 20);
             $post_id = $this->createReadOnlyPage('how-do-i-checkout-a-single-guest', 'How do I checkout a single guest?', $hp->toHtml('how-do-i-checkout-a-single-guest'), $faq_id, 30);
             $post_id = $this->createReadOnlyPage('how-do-i-checkout-all-guests-for-a-booking', 'How do I checkout all guests for a booking?', $hp->toHtml('how-do-i-checkout-all-guests-for-a-booking'), $faq_id, 40);
             $post_id = $this->createReadOnlyPage('how-do-i-add-additional-nights-to-an-existing-booking', 'How do I add additional nights to an existing booking?', $hp->toHtml('how-do-i-add-additional-nights-to-an-existing-booking'), $faq_id, 50);
             $post_id = $this->createReadOnlyPage('how-do-i-cancel-nights-from-an-existing-booking', 'How do I cancel nights from an existing booking?', $hp->toHtml('how-do-i-cancel-nights-from-an-existing-booking'), $faq_id, 60);
             $post_id = $this->createReadOnlyPage('how-do-i-change-the-room-allocation-for-a-booking', 'How do I change the room allocation for a booking?', $hp->toHtml('how-do-i-change-the-room-allocation-for-a-booking'), $faq_id, 70);
             $post_id = $this->createReadOnlyPage('how-do-i-deactivate-a-room-for-a-particular-set-of-dates', 'How do I deactivate a room for a particular set of dates?', $hp->toHtml('how-do-i-deactivate-a-room-for-a-particular-set-of-dates'), $faq_id, 80);
         }
     }
     return $help_id;
 }