Skip to main content

GravityKit\GravityFormsElementorWidget\Block_Styles

Registers widget controls for the style settings of the Gravity Forms form block, and turns the saved widget

settings into the attributes the block would save for the same choices.

Gravity Forms renders the form from those attributes, so a widget and a block with equivalent settings produce the same output. No control here writes CSS of its own. Controls whose setting the installed Gravity Forms does not accept are left out, so newer settings appear once Gravity Forms supports them.

Since: TBD

Source: src/Block_Styles.php:30

Details​

  • Kind: class
  • Namespace: GravityKit\GravityFormsElementorWidget

Methods​

MethodDescription
supports()Returns whether the installed Gravity Forms accepts a style setting.
get_elements()Returns the form elements the block styles individually.
register_controls()Registers the Style tab sections for the block's style settings.
to_attributes()Converts widget settings to the style attributes the block would save for the same choices.

Method Reference​

supports()​

public static function supports( $key )

Returns whether the installed Gravity Forms accepts a style setting.

Gravity Forms drops setting names it does not know before rendering, so its own filter is the test.

Parameters​

NameTypeDefaultDescription
$keystringForm block attribute.

Returns​

  • bool

Since: TBD

Source: src/Block_Styles.php:73

get_elements()​

public static function get_elements()

Returns the form elements the block styles individually.

Returns​

  • array[] — Element definitions keyed by control prefix. Changing a prefix orphans saved settings.

Since: TBD

Source: src/Block_Styles.php:98

register_controls()​

public static function register_controls( Widget_Base $widget, $orbital_condition, $section_form_ids )

Registers the Style tab sections for the block's style settings.

Parameters​

NameTypeDefaultDescription
$widgetWidget_BaseWidget.
$orbital_conditionarrayCondition matching the Orbital theme; Gravity Forms applies these settings only there.
$section_form_idsstring[]IDs of forms with a Section Break field.

Since: TBD

Source: src/Block_Styles.php:208

to_attributes()​

public static function to_attributes( $settings )

Converts widget settings to the style attributes the block would save for the same choices.

Parameters​

NameTypeDefaultDescription
$settingsarraySaved widget settings (raw, including controls currently hidden).

Returns​

  • array — Attribute values keyed by Gravity Forms attribute, only those set.

Since: TBD

Source: src/Block_Styles.php:927