Jake Vanderwerf
10 days ago de317675a8069b747cb253ba3e2b5dc394ca36ef
inc/managers/ReferralManager.php
@@ -95,7 +95,8 @@
      add_action('admin_notices', [$this, 'showReferralPageNotice']);
      add_filter('jvbDashboardPage', [$this, 'renderDashPage'], 10, 2);
      add_action(BASE.'dashboard_page_referrals', [$this, 'renderDashPage'], 10);
//    add_filter('jvbDashboardPage', [$this, 'renderDashPage'], 10, 2);
      // Handle settings save
      add_action('admin_init', [$this, 'registerSettings']);
@@ -1265,7 +1266,7 @@
            <p class="hint">Can\'t find it? Check your spam folder.</p>
         </div>',
         jvbFormStatus(),
         esc_attr(get_option(BASE.'referral_role','client')),
         esc_attr(Site::getReferralRole()),
         Form::render('referral_name', '', [
            'required'  => true,
            'type'      => 'text',
@@ -1301,6 +1302,7 @@
         '<form id="login-form">%s%s%s
         <button type="submit">%sLogin With Magic Link</button>
      </form>
      <div class="success-content" hidden>
         <h3>Check Your Email!</h3>
         <p>We\'ve sent you a magic link to log in - no password required! Click the link in your email to log in.</p>
@@ -2615,12 +2617,8 @@
      }
   }
   public function renderDashPage(string $content, string $page): string
   public function renderDashPage():void
   {
      if ($page !== 'Referrals') {
         return $content;
      }
      // Regular users get their referral dashboard
      $user_id = get_current_user_id();
@@ -2632,7 +2630,6 @@
      $referrals = $this->getUserReferrals($user_id, ['per_page' => 20]);
      ob_start();
      $tabs = new Tabs();
      $tabs->addTab('share')
@@ -2647,11 +2644,10 @@
      ?>
      <div class="referral-dashboard">
         <?= $tabs->render(true);?>
         <?= $tabs->render();?>
      </div>
      <?php
      return ob_get_clean();
   }
   protected function shareDashboard(int $user_id, string $referral_code):string