/**
  * Transition for when the user selects the page to connect to.
  *
  * This transition stores page info including the long-lived access token information.
  */
 private static function transition_select_page($page_id)
 {
     if (!$page_id) {
         throw new InvalidArgumentException('Missing Page ID when selcting the page');
     }
     $fb_helper = new Instant_Articles_Wizard_FB_Helper();
     $pages = $fb_helper->get_pages();
     if (!$pages[$page_id]) {
         throw new InvalidArgumentException('Invalid Page ID when selcting the page');
     }
     if (!$pages[$page_id]['supports_instant_articles']) {
         throw new InvalidArgumentException('Selected page is not signed up to Instant Articles');
     }
     Instant_Articles_Option_FB_Page::update_option($pages[$page_id]);
     // Update the option before claiming the URL.
     $success = update_option('instant-articles-current-state', self::STATE_STYLE_SELECTION);
     // You should always claim the URL after updating the FB Page option so the fb:pages meta tag is rendered.
     if ($success) {
         self::claim_url();
     }
     return $success;
 }