10 public $icon =
'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDguMyA1NTkuNSIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiIGNsYXNzPSJkYXNoaWNvbiBkYXNoaWNvbi1ncmF2aXR5Zm9ybXMiIHJvbGU9ImltZyI+PGc+PHBhdGggY2xhc3M9InN0MCIgZD0iTTQ2OCwxMDkuOEwyOTQuNCw5LjZjLTIyLjEtMTIuOC01OC40LTEyLjgtODAuNSwwTDQwLjMsMTA5LjhDMTguMiwxMjIuNiwwLDE1NCwwLDE3OS41VjM4MAljMCwyNS42LDE4LjEsNTYuOSw0MC4zLDY5LjdsMTczLjYsMTAwLjJjMjIuMSwxMi44LDU4LjQsMTIuOCw4MC41LDBMNDY4LDQ0OS44YzIyLjItMTIuOCw0MC4zLTQ0LjIsNDAuMy02OS43VjE3OS42CUM1MDguMywxNTQsNDkwLjIsMTIyLjYsNDY4LDEwOS44eiBNMzk5LjMsMjQ0LjRsLTE5NS4xLDBjLTExLDAtMTkuMiwzLjItMjUuNiwxMGMtMTQuMiwxNS4xLTE4LjIsNDQuNC0xOS4zLDYwLjdIMzQ4di0yNi40aDQ5LjkJdjc2LjNIMTExLjNsLTEuOC0yM2MtMC4zLTMuMy01LjktODAuNywzMi44LTEyMS45YzE2LjEtMTcuMSwzNy4xLTI1LjgsNjIuNC0yNS44aDE5NC43VjI0NC40eiI+PC9wYXRoPjwvZz48L3N2Zz4=';
20 $doing_ajax = defined(
'DOING_AJAX' ) && DOING_AJAX &&
'gv_field_options' ===
\GV\Utils::_POST(
'action' );
21 $editing_view =
'edit' ===
\GV\Utils::_GET(
'action' ) &&
'gravityview' === get_post_type( \
GV\Utils::_GET(
'post' ) );
22 $is_frontend =
gravityview()->request->is_frontend();
24 if ( ! $doing_ajax && ! $editing_view && ! $is_frontend ) {
28 $this->widget_description = __(
'Display a Gravity Forms form.',
'gk-gravityview' );
30 $default_values = array(
36 'widget_form_id' => array(
38 'label' => __(
'Form to display',
'gk-gravityview' ),
44 'label' => __(
'Show form title?',
'gk-gravityview' ),
47 'description' => array(
49 'label' => __(
'Show form description?',
'gk-gravityview' ),
54 'label' => __(
'Enable AJAX',
'gk-gravityview' ),
58 'field_values' => array(
60 'class' =>
'code widefat',
61 'label' => __(
'Field value parameters',
'gk-gravityview' ),
62 'desc' =>
'<a href="https://docs.gravityforms.com/using-dynamic-population/" rel="external">' . esc_html__(
'Learn how to dynamically populate a field.',
'gk-gravityview' ) .
'</a>',
67 add_filter(
'gravityview/widget/hide_until_searched/allowlist', array( $this,
'add_to_allowlist' ) );
69 parent::__construct( __(
'Gravity Forms',
'gk-gravityview' ) ,
'gravityforms', $default_values,
$settings );
82 0 =>
'— ' . esc_html__(
'list of forms',
'gk-gravityview' ) .
'—',
85 if ( ! class_exists(
'GFAPI' ) ) {
95 $table = GFFormsModel::get_form_table_name();
97 $results = $wpdb->get_results(
"SELECT id, title FROM ${table} WHERE is_active = 1" );
99 if ( ! empty( $results ) ) {
100 foreach ( $results as
$form ) {
101 $choices[ $form->id ] = $form->title;
117 $allowlist[] =
'gravityforms';
147 if ( isset( GFFormDisplay::$submission[
$form_id ] ) ) {
149 unset( GFFormDisplay::$submission[ $form_id ] );
151 gravity_form( $form_id, ! empty(
$title ), ! empty(
$description ),
false, $field_values, $ajax );
static _GET( $name, $default=null)
Grab a value from the _GET superglobal or default.
if(gravityview() ->plugin->is_GF_25()) $form
if(empty( $field_settings['content'])) $content
if(empty( $created_by)) $form_id
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
gravityview()
The main GravityView wrapper function.
static _POST( $name, $default=null)
Grab a value from the _POST superglobal or default.