diff --git a/gravityview.php b/gravityview.php index 277ff3515..85fac6052 100644 --- a/gravityview.php +++ b/gravityview.php @@ -369,8 +369,8 @@ public static function get_default_widget_areas() { * @access public * @return void */ - function default_field_blacklist() { - return array( 'html', 'section', 'captcha', 'page' ); + function default_field_blacklist( $array = array() ) { + return array_merge( $array, array( 'html', 'section', 'captcha', 'page' ) ); } diff --git a/includes/connector-functions.php b/includes/connector-functions.php index 82d5237b1..0bff3e212 100644 --- a/includes/connector-functions.php +++ b/includes/connector-functions.php @@ -73,7 +73,7 @@ function gravityview_get_forms() { * @param string|array $form_id (default: '') or $form object * @return array */ - function gravityview_get_form_fields( $form = '', $add_default_properties = false ) { + function gravityview_get_form_fields( $form = '', $add_default_properties = false, $include_parent_field = true ) { if( !is_array( $form ) ) { $form = gravityview_get_form( $form ); @@ -87,7 +87,10 @@ function gravityview_get_form_fields( $form = '', $add_default_properties = fals if( $form ) { foreach( $form['fields'] as $field ) { - $fields[ $field['id'] ] = array( 'label' => $field['label'], 'type' => $field['type'] ); + + if( $include_parent_field || empty( $field['inputs'] ) ) { + $fields[ $field['id'] ] = array( 'label' => $field['label'], 'type' => $field['type'] ); + } if( $add_default_properties && !empty( $field['inputs'] ) ) { foreach( $field['inputs'] as $input ) { @@ -236,17 +239,19 @@ function gravityview_get_sortable_fields( $formid, $current = '' ) { return $output; } - $fields = gravityview_get_form_fields( $formid ); + // Get fields with sub-inputs and no parent + $fields = gravityview_get_form_fields( $formid, true, false ); if( !empty( $fields ) ) { - $blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', array() ); + $blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', array( 'list', 'textarea' ) ); $output .= ''; + foreach( $fields as $id => $field ) { - if( in_array( $field['type'], $blacklist_field_types ) ) { - continue; - } + + if( in_array( $field['type'], $blacklist_field_types ) ) { continue; } + $output .= ''; } diff --git a/readme.txt b/readme.txt index 94c574479..36c43af02 100644 --- a/readme.txt +++ b/readme.txt @@ -33,9 +33,13 @@ Beautifully display your Gravity Forms entries. * Added: `search_field` parameter to the shortcode. This allows you to specify a field ID where you want the search performed (The search itself is defined in `search_value`) * Added: [Using the Shortcode](https://katzwebservices.zendesk.com/hc/en-us/articles/202934188) help article * Added: Data Source added to the Views page -* Fixed: Apostrophes no longer have slashes before them +* Fixed: Field labels escaping issue (`It's an Example` was displaying as `It\'s an Example`) * Fixed: Settings "gear" not showing when adding a new field +* Fixed: Sorting issues + - Remove the option to sort by composite fields like Name, Address, Product; Gravity Forms doesn't process those sort requests properly + - Remove List and Paragraph fields from being sortable * Improved: Added visibility toggles to some Field Settings. For example, if the "Show Label" setting is not checked, then the "Custom Label" setting is hidden. +* Modified how data is sent to the template: removed the magic methods getter/setters setting the `$var` variable - not data is stored directly as object parameters. * Added many translations. Thanks everyone! * Bengali translation by [@tareqhi](https://www.transifex.com/accounts/profile/tareqhi/) * German translation by [@seschwarz](https://www.transifex.com/accounts/profile/seschwarz/)