code: public function onPagesLoaded(array &$pages)
      {
          unset($pages["403"]);
  
          if (!$this->config["alterPageArray"]) {
              return;
          }
  
          // Erase all pages if an error occurred
          if ($this->errorOccurred) {
              $pages = array();
              return;
          }
  
          foreach ($pages as $id => $page) {
              try {
                  $allowed = $this->checkAccess($id);
              } catch (\Exception $e) {
                  $this->errorHandler($e, $this->requestUrl);
                  $pages = array();
                  return;
              }
  
              if (!$allowed) {
                  unset($pages[$id]);
              }
          }
      }
docs: Pico API event - onPagesLoaded
  
  Removes pages that should not be displayed in the menus
  (for example the 403 page) from the Pico's page array.
  If "alterPageArray" plugin configuration is enabled, the pages with
  restricted access are also removed from the page array.
  
  @param array $pages Pico page array