| | |
| | | class MakeCalendarType { |
| | | protected string $slug; |
| | | protected string $postType; |
| | | protected Registrar $registrar; |
| | | private Registrar $registrar; |
| | | public function __construct(string $slug, Registrar $registrar) { |
| | | $this->slug = $slug; |
| | | $this->postType = jvbCheckBase($slug); |
| | |
| | | add_action('init', [$this, 'addCalendarRewrites']); |
| | | } |
| | | |
| | | |
| | | public function __debugInfo() { |
| | | $vars = get_object_vars($this); |
| | | unset($vars['registrar']); |
| | | return $vars; |
| | | } |
| | | |
| | | protected function addCalendarFields():void |
| | | { |
| | | |
| | |
| | | 'max_participants' => [ |
| | | 'type' => 'number', |
| | | 'label' => __('Maximum Participants', 'jvb'), |
| | | 'bulkEdit'=> true, |
| | | ], |
| | | 'is_free' => [ |
| | | 'type' => 'true_false', |
| | | 'label' => 'Free Event?', |
| | | 'default' => 1, |
| | | 'bulkEdit'=> true, |
| | | ], |
| | | 'cost' => [ |
| | | 'type' => 'number', |
| | |
| | | 'operator' => '!=', |
| | | 'value' => 1 |
| | | ], |
| | | 'bulkEdit'=> true, |
| | | ], |
| | | 'ticket_url' => [ |
| | | 'type' => 'url', |
| | |
| | | 'type' => 'true_false', |
| | | 'label' => 'Drop-ins Welcome?', |
| | | 'default' => true, |
| | | 'bulkEdit'=> true, |
| | | ], |
| | | 'recurrence' => [ |
| | | 'type' => 'group', |