'gform_widget', 'description' => $description ), array( 'width' => 200, 'height' => 250, 'id_base' => 'gform_widget' ) ); } /** * Handles outputting of the widget content * * @see WP_Widget::widget * @see RGFormsModel::get_form_meta * @see RGForms::print_form_scripts * @see RGForms::get_form * * @param array $args Arguments provided to the widget * @param array $instance Saved database values for the widget */ function widget( $args, $instance ) { extract( $args ); echo $before_widget; /** * Filters the widget title. * * @since 2.4.10 Added the $instance and $id_base args. * @since unknown * * @param string $title The widget title. * @param array $instance Saved database values for the widget. * @param mixed $id_base The widget ID. */ $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); if ( $title ) { echo $before_title . $title . $after_title; } $tabindex = is_numeric( $instance['tabindex'] ) ? $instance['tabindex'] : 0; // Creating form $form = RGFormsModel::get_form_meta( $instance['form_id'] ); if ( empty( $instance['disable_scripts'] ) && ! is_admin() ) { RGForms::print_form_scripts( $form, $instance['ajax'] ); } $form_markup = RGForms::get_form( $instance['form_id'], $instance['showtitle'], $instance['showdescription'], false, null, $instance['ajax'], $tabindex ); // Display form echo $form_markup; echo $after_widget; } /** * Handles updates to the widget content * * @param array $new_instance The new instance of the widget * @param array $old_instance The old instance of the widget * * @return array The widget instance, after changes have occurred */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['form_id'] = rgar( $new_instance, 'form_id' ); $instance['showtitle'] = rgar( $new_instance, 'showtitle' ); $instance['ajax'] = rgar( $new_instance, 'ajax' ); $instance['disable_scripts'] = rgar( $new_instance, 'disable_scripts' ); $instance['showdescription'] = rgar( $new_instance, 'showdescription' ); $instance['tabindex'] = rgar( $new_instance, 'tabindex', 0 ); return $instance; } /** * Outputs the form options for the widget * * @param array $instance The widget instance * * @return void */ function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Contact Us', 'gravityforms' ), 'tabindex' => '0' ) ); ?>

value="1" />
value="1" />