$offerings * @var \Unsupervised\Schedular\Offering\Offering|null $editing Offering loaded into the form, or null when adding. */ $baseUrl = admin_url('admin.php?page=us-offerings'); // Prefill the sessions control from the stored term dates: a term longer than // one day was created as weekly sessions one week apart. $termRecurrence = 'single'; $termSessions = 10; if ($editing && null !== $editing->termStart && null !== $editing->termEnd && $editing->termEnd !== $editing->termStart) { $termRecurrence = 'weekly'; $termSessions = (int) round(((int) strtotime($editing->termEnd) - (int) strtotime($editing->termStart)) / 604800) + 1; } ?>