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
| Method | Description |
|---|---|
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
| Name | Type | Default | Description |
|---|---|---|---|
$key | string | Form 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
| Name | Type | Default | Description |
|---|---|---|---|
$widget | Widget_Base | Widget. | |
$orbital_condition | array | Condition matching the Orbital theme; Gravity Forms applies these settings only there. | |
$section_form_ids | string[] | 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
| Name | Type | Default | Description |
|---|---|---|---|
$settings | array | Saved 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