var form = " . json_encode( $form ) . ';'; } else { echo ""; } ?>

', '' ) ?>
  • >

    1.

    2.

    3.

    4.

    5.


'; /** * A filter to allow you to modify the Form Save button * * @param string $save_button The Form Save button HTML */ $save_button = apply_filters( 'gform_save_form_button', $save_button ); echo $save_button; $cancel_button = '' . esc_html__( 'Cancel', 'gravityforms' ) . ''; /** * A filter to allow you to modify the Form Cancel button * * @param string $cancel_button The Form Cancel button HTML */ $cancel_button = apply_filters( 'gform_cancel_form_button', $cancel_button ); echo $cancel_button; if ( GFCommon::current_user_can_any( 'gravityforms_delete_forms' ) ) { $trash_link = '' . __( 'Move to Trash', 'gravityforms' ) . ''; /** * @deprecated */ $trash_link = apply_filters( 'gform_form_delete_link', $trash_link ); /** * Allows for modification of the Form Trash Link. * * @since 2.1.2.3 Added the $form_id param. * @since 1.8 * * @param string $trash_link The Trash link HTML. * @param int $form_id The ID of the form being edited. */ echo apply_filters( 'gform_form_trash_link', $trash_link, $form_id ); } ?>
array( 'name' => 'standard_fields', 'label' => __( 'Standard Fields', 'gravityforms' ), 'tooltip_class' => 'tooltip_bottomleft', 'fields' => array( array( 'class' => 'button', 'data-type' => 'text', 'value' => GFCommon::get_field_type_title( 'text' ) ), array( 'class' => 'button', 'data-type' => 'textarea', 'value' => GFCommon::get_field_type_title( 'textarea' ) ), array( 'class' => 'button', 'data-type' => 'select', 'value' => GFCommon::get_field_type_title( 'select' ) ), array( 'class' => 'button', 'data-type' => 'multiselect', 'value' => GFCommon::get_field_type_title( 'multiselect' ) ), array( 'class' => 'button', 'data-type' => 'number', 'value' => GFCommon::get_field_type_title( 'number' ) ), array( 'class' => 'button', 'data-type' => 'checkbox', 'value' => GFCommon::get_field_type_title( 'checkbox' ) ), array( 'class' => 'button', 'data-type' => 'radio', 'value' => GFCommon::get_field_type_title( 'radio' ) ), array( 'class' => 'button', 'data-type' => 'hidden', 'value' => GFCommon::get_field_type_title( 'hidden' ) ), array( 'class' => 'button', 'data-type' => 'html', 'value' => GFCommon::get_field_type_title( 'html' ) ), array( 'class' => 'button', 'data-type' => 'section', 'value' => GFCommon::get_field_type_title( 'section' ) ), array( 'class' => 'button', 'data-type' => 'page', 'value' => GFCommon::get_field_type_title( 'page' ) ), ), ), 'advanced_fields' => array( 'name' => 'advanced_fields', 'label' => __( 'Advanced Fields', 'gravityforms' ), 'fields' => array( array( 'class' => 'button', 'data-type' => 'name', 'value' => GFCommon::get_field_type_title( 'name' ) ), array( 'class' => 'button', 'data-type' => 'date', 'value' => GFCommon::get_field_type_title( 'date' ) ), array( 'class' => 'button', 'data-type' => 'time', 'value' => GFCommon::get_field_type_title( 'time' ) ), array( 'class' => 'button', 'data-type' => 'phone', 'value' => GFCommon::get_field_type_title( 'phone' ) ), array( 'class' => 'button', 'data-type' => 'address', 'value' => GFCommon::get_field_type_title( 'address' ) ), array( 'class' => 'button', 'data-type' => 'website', 'value' => GFCommon::get_field_type_title( 'website' ) ), array( 'class' => 'button', 'data-type' => 'email', 'value' => GFCommon::get_field_type_title( 'email' ) ), array( 'class' => 'button', 'data-type' => 'fileupload', 'value' => GFCommon::get_field_type_title( 'fileupload' ) ), array( 'class' => 'button', 'data-type' => 'captcha', 'value' => GFCommon::get_field_type_title( 'captcha' ) ), array( 'class' => 'button', 'data-type' => 'list', 'value' => GFCommon::get_field_type_title( 'list' ) ), ), ), 'post_fields' => array( 'name' => 'post_fields', 'label' => __( 'Post Fields', 'gravityforms' ), 'fields' => array( array( 'class' => 'button', 'data-type' => 'post_title', 'value' => GFCommon::get_field_type_title( 'post_title' ) ), array( 'class' => 'button', 'data-type' => 'post_content', 'value' => GFCommon::get_field_type_title( 'post_content' ) ), array( 'class' => 'button', 'data-type' => 'post_excerpt', 'value' => GFCommon::get_field_type_title( 'post_excerpt' ) ), array( 'class' => 'button', 'data-type' => 'post_tags', 'value' => GFCommon::get_field_type_title( 'post_tags' ) ), array( 'class' => 'button', 'data-type' => 'post_category', 'value' => GFCommon::get_field_type_title( 'post_category' ) ), array( 'class' => 'button', 'data-type' => 'post_image', 'value' => GFCommon::get_field_type_title( 'post_image' ) ), array( 'class' => 'button', 'data-type' => 'post_custom_field', 'value' => GFCommon::get_field_type_title( 'post_custom_field' ) ), ), ), 'pricing_fields' => array( 'name' => 'pricing_fields', 'label' => __( 'Pricing Fields', 'gravityforms' ), 'fields' => array( array( 'class' => 'button', 'data-type' => 'product', 'value' => GFCommon::get_field_type_title( 'product' ) ), array( 'class' => 'button', 'data-type' => 'quantity', 'value' => GFCommon::get_field_type_title( 'quantity' ) ), array( 'class' => 'button', 'data-type' => 'option', 'value' => GFCommon::get_field_type_title( 'option' ) ), array( 'class' => 'button', 'data-type' => 'shipping', 'value' => GFCommon::get_field_type_title( 'shipping' ) ), array( 'class' => 'button', 'data-type' => 'total', 'value' => GFCommon::get_field_type_title( 'total' ) ), ), ), ); // If enabled insert the password field between the email and fileupload fields. if ( apply_filters( 'gform_enable_password_field', false ) ) { $password = array( 'class' => 'button', 'data-type' => 'password', 'value' => GFCommon::get_field_type_title( 'password' ) ); array_splice( $field_groups['advanced_fields']['fields'], 7, 0, array( $password ) ); } // Add credit card field, if enabled. if ( apply_filters( 'gform_enable_credit_card_field', false ) ) { $field_groups['pricing_fields']['fields'][] = array( 'class' => 'button', 'data-type' => 'creditcard', 'value' => GFCommon::get_field_type_title( 'creditcard' ) ); } /** * Modify the field groups before fields are added. * * @since 2.2.6 * * @param array $field_groups The field groups, including group name, label and fields. */ $field_groups = apply_filters( 'gform_field_groups_form_editor', $field_groups ); // Remove array keys from field groups array. $field_groups = array_values( $field_groups ); // Add buttons to fields. foreach ( GF_Fields::get_all() as $gf_field ) { $field_groups = $gf_field->add_button( $field_groups ); } /** * Add/edit/remove "Add Field" buttons from the form editor's floating toolbox. * * @param array $field_groups The field groups, including group name, label and fields. */ return apply_filters( 'gform_add_field_buttons', $field_groups ); } public static function color_picker( $field_name, $callback ) { ?>
'; } } //Hierarchical category functions copied from WordPress core and modified. private static function _cat_rows( $categories, &$count, &$output, $parent = 0, $level = 0, $page = 1, $per_page = 9999999 ) { if ( empty( $categories ) ) { $args = array( 'hide_empty' => 0 ); if ( ! empty( $_POST['search'] ) ) $args['search'] = $_POST['search']; $categories = get_categories( $args ); } if ( ! $categories ) return false; $children = self::_get_term_hierarchy( 'category' ); $start = ( $page - 1 ) * $per_page; $end = $start + $per_page; $i = - 1; foreach ( $categories as $category ) { if ( $count >= $end ) break; $i ++; if ( $category->parent != $parent ) continue; // If the page starts in a subtree, print the parents. if ( $count == $start && $category->parent > 0 ) { $my_parents = array(); while ( $my_parent ) { $my_parent = get_category( $my_parent ); $my_parents[] = $my_parent; if ( ! $my_parent->parent ) break; $my_parent = $my_parent->parent; } $num_parents = count( $my_parents ); while ( $my_parent = array_pop( $my_parents ) ) { self::_cat_row( $my_parent, $level - $num_parents, $output ); $num_parents --; } } if ( $count >= $start ) self::_cat_row( $category, $level, $output ); //unset($categories[ $i ]); // Prune the working set $count ++; if ( isset( $children[ $category->term_id ] ) ) self::_cat_rows( $categories, $count, $output, $category->term_id, $level + 1, $page, $per_page ); } } private static function _cat_row( $category, $level, &$output, $name_override = false ) { static $row_class = ''; $cat = get_category( $category, OBJECT, 'display' ); $default_cat_id = (int) get_option( 'default_category' ); $pad = str_repeat( '— ', $level ); $name = ( $name_override ? $name_override : $pad . ' ' . $cat->name ); $cat->count = number_format_i18n( $cat->count ); $output .= " $name "; } private static function _get_term_hierarchy( $taxonomy ) { if ( ! is_taxonomy_hierarchical( $taxonomy ) ) return array(); $children = get_option( "{$taxonomy}_children" ); if ( is_array( $children ) ) return $children; $children = array(); $terms = get_terms( $taxonomy, 'get=all' ); foreach ( $terms as $term ) { if ( $term->parent > 0 ) $children[ $term->parent ][] = $term->term_id; } update_option( "{$taxonomy}_children", $children ); return $children; } private static function insert_variable_prepopulate( $element_id, $callback = '' ) { ?>