Skip to main content

GravityKit\GravityCalendar\Abilities\Support\CalendarLookup

Every ability starts from a calendar id; this is the one place that turns it into a feed.

Reads go through Gravity Forms' uncached GFAPI::get_feed() and the add-on's uncached get_feeds(), never GV_Extension_Calendar_Feed::get_feed(), whose per-process cache would hide a write made earlier in the same request.

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:27

Details​

  • Kind: class
  • Namespace: GravityKit\GravityCalendar\Abilities\Support

Methods​

MethodDescription
addon_slug()The add-on slug stored on every calendar feed.
feed()The calendar's feed, read fresh, or a calendar_not_found error.
feeds()Calendar feeds, read fresh with their meta decrypted, ordered as Gravity Forms lists them.
form()A Gravity Forms form, or a form_not_found error naming the tool that lists forms.
summary()One row of gc_calendars_list.
edit_url()The calendar's wp-admin settings screen.
summary_schema()The output schema of one {@see self::summary()} row.

Method Reference​

addon_slug()​

public static function addon_slug(): string

The add-on slug stored on every calendar feed.

Returns​

  • string

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:36

feed()​

public static function feed( int $feed_id )

The calendar's feed, read fresh, or a calendar_not_found error.

Another add-on's feed id gets the same error as a missing one.

Parameters​

NameTypeDefaultDescription
$feed_idintThe calendar id.

Returns​

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:51

feeds()​

public static function feeds( ?int $form_id=null ): array

Calendar feeds, read fresh with their meta decrypted, ordered as Gravity Forms lists them.

Parameters​

NameTypeDefaultDescription
$form_idint | nullnullOnly this form's calendars; null for every calendar.

Returns​

  • array[]

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:95

form()​

public static function form( int $form_id )

A Gravity Forms form, or a form_not_found error naming the tool that lists forms.

Parameters​

NameTypeDefaultDescription
$form_idintThe form id.

Returns​

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:108

summary()​

public static function summary( array $feed ): array

One row of gc_calendars_list.

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed row.

Returns​

  • array{id:int, — form_id:int, form_title:string, name:string, is_active:bool, is_secure:bool, layout:string, shortcode:string, edit_url:string}

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:136

edit_url()​

public static function edit_url( int $feed_id, int $form_id ): string

The calendar's wp-admin settings screen.

Parameters​

NameTypeDefaultDescription
$feed_idintThe calendar id.
$form_idintIts form id.

Returns​

  • string

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:164

summary_schema()​

public static function summary_schema(): array

The output schema of one {@see self::summary()} row.

Returns​

  • array

Since: TBD

Source: includes/abilities/Support/CalendarLookup.php:184