Skip to main content

GravityKit\GravityFormsElementorWidget\Widget

Gravity Forms widget for Elementor.

Integrates Gravity Forms with Elementor page builder.

Since: 1.0.0

Source: src/Widget.php:33

Details​

  • Kind: class
  • Namespace: GravityKit\GravityFormsElementorWidget
  • Extends: Widget_Base

Methods​

MethodDescription
get_name()Retrieves Gravity Forms widget name.
get_title()Retrieves Gravity Forms widget title.
get_categories()Retrieves the list of categories the Gravity Forms widget belongs to.
get_keywords()Retrieves Gravity Forms widget keywords.
get_icon()Returns widget icon.
get_custom_icon()Returns widget custom icon.
render_plain_content()Keeps the form out of the post content Elementor writes when a page is saved.
get_default_theme()Returns the theme Gravity Forms uses for a form that doesn't choose one.
get_block_attributes()Returns the attributes the Gravity Forms form block would save for the same settings.
enqueue_editor_styles()Enqueues editor styles.

Method Reference​

get_name()​

public function get_name()

Retrieves Gravity Forms widget name.

Returns​

  • string — Widget name.

Since: 1.0.0

Source: src/Widget.php:52

get_title()​

public function get_title()

Retrieves Gravity Forms widget title.

Returns​

  • string — Widget title.

Since: 1.0.0

Source: src/Widget.php:65

get_categories()​

public function get_categories()

Retrieves the list of categories the Gravity Forms widget belongs to.

Returns​

  • array — Widget categories.

Since: 1.0.0

Source: src/Widget.php:78

get_keywords()​

public function get_keywords()

Retrieves Gravity Forms widget keywords.

Returns​

  • array — Widget keywords.

Since: 1.0.0

Source: src/Widget.php:91

get_icon()​

public function get_icon()

Returns widget icon.

Returns​

  • string — Widget icon.

Since: 1.0.0

Source: src/Widget.php:110

get_custom_icon()​

public static function get_custom_icon()

Returns widget custom icon.

Returns​

  • string — Widget custom icon.

Since: 1.0.0

Source: src/Widget.php:123

render_plain_content()​

public function render_plain_content()

Keeps the form out of the post content Elementor writes when a page is saved.

Elementor renders each widget as the person saving and stores the result in the post content, where search, the REST API and feeds read it. A form's default values can come from the person looking at it, so nothing is saved.

Returns​

  • void

See Also​

  • \Elementor\DB::save_plain_text()

Since: TBD

Source: src/Widget.php:493

get_default_theme()​

public static function get_default_theme()

Returns the theme Gravity Forms uses for a form that doesn't choose one.

Reads Gravity Forms' option directly: GFForms::get_default_theme() only exists from Gravity Forms 2.9.

Returns​

  • string — Theme slug.

Since: TBD

Source: src/Widget.php:685

get_block_attributes()​

public static function get_block_attributes( $form_id, $settings )

Returns the attributes the Gravity Forms form block would save for the same settings.

Parameters​

NameTypeDefaultDescription
$form_idintForm ID.
$settingsarraySaved widget settings, merged with control defaults.

Returns​

  • array — Attributes in the block's registration order.

Since: TBD

Source: src/Widget.php:699

enqueue_editor_styles()​

public static function enqueue_editor_styles()

Enqueues editor styles.

Since: 1.0.0

Source: src/Widget.php:884