'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 * @param string $instance['title'] The title */ $title = apply_filters( 'widget_title', $instance['title'] ); if ( $title ) { echo $before_title . $title . $after_title; } $tabindex = is_numeric( $instance['tabindex'] ) ? $instance['tabindex'] : 1; // 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' ); 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' => '1' ) ); ?>

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