Skip to main content

GravityKit\GravityCalendar\Elementor\ShortcodeBuilder

Maps Elementor widget settings onto [gravitycalendar] shortcode attributes.

Holds no reference to any Elementor\* symbol, so it loads and is testable without Elementor.

Since: 2.22.0

Source: includes/elementor/class-calendar-elementor-shortcode-builder.php:20

Details

  • Kind: class
  • Namespace: GravityKit\GravityCalendar\Elementor

Methods

MethodDescription
from_settings()Converts Elementor widget settings into [gravitycalendar] attributes.

Method Reference

from_settings()

public static function from_settings( array $settings ): array

Converts Elementor widget settings into [gravitycalendar] attributes.

The handler whitelists id, secret and height and discards everything else (gv_calendar_shortcode_handler()), so this returns those and nothing more.

The secret is computed on every render and never read from $settings. Storing it in Elementor's saved data would freeze it: a feed switched to secure after the page was saved would then render the "invalid secret" error instead of the calendar, and the secret would be readable by anyone who can load the page's editor data.

Parameters

NameTypeDefaultDescription
$settingsarrayElementor widget settings.

Returns

  • array — Shortcode attributes. Always has id; has height and secret only when they apply.

Since: 2.22.0

Source: includes/elementor/class-calendar-elementor-shortcode-builder.php:38