Skip to content

Commit cc84454

Browse files
committed
Formatting: Fixed PHPCS issues.
1 parent 7714888 commit cc84454

12 files changed

+39
-38
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
33
* This snippet has evolved! 🦄
4-
* Find the new version of this snippet here:
4+
* Find the new version of this snippet here:
55
* https://github.com/gravitywiz/snippet-library/blob/master/gp-address-autocomplete/gpaa-show-place-name.js
66
*/

gp-entry-blocks/gpeb-allow-edit-by-user-meta.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
add_filter( 'gpeb_can_user_edit_entry', function( $can_user_edit_entry, $entry, $current_user_id ) {
1818
$current_user = new WP_User( $current_user_id );
19-
// Update "entry_ids" to whatever user meta key you're storing entry IDs for which the user has permission to edit.
19+
// Update "entry_ids" to whatever user meta key you're storing entry IDs for which the user has permission to edit.
2020
if ( in_array( $entry['id'], (array) $current_user->get( 'entry_ids' ) ) ) {
2121
$can_user_edit_entry = true;
2222
}
23-
returN $can_user_edit_entry;
23+
return $can_user_edit_entry;
2424
}, 10, 3 );

gp-inventory/gpi-dynamic-scopes-for-combo-inventories.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* 1. Install the snippet.
2727
* https://gravitywiz.com/documentation/managing-snippets/#where-do-i-put-snippets
28-
*
28+
*
2929
* 2. Update the inline variables with your form and field IDs.
3030
*/
3131
add_filter( 'gpi_query', function( $query, $field ) {
@@ -42,18 +42,17 @@
4242
*/
4343
if ( $field->id === $ultimate_field_id ) {
4444
$fields_to_alter = array( $standard_field_id, $super_field_id, $ultimate_field_id );
45-
}
46-
/**
47-
* We're querying for the Standard or Super field's (inventory-enabled Drop Down fields with available rooms) inventory.
48-
* Let's ensure that the Ultimate field's claimed inventory is included in the Standard and Super fields'.
49-
*/
50-
else if ( in_array( $field->id, array( $standard_field_id, $super_field_id ) ) ) {
45+
} elseif ( in_array( $field->id, array( $standard_field_id, $super_field_id ) ) ) {
46+
/**
47+
* We're querying for the Standard or Super field's (inventory-enabled Drop Down fields with available rooms) inventory.
48+
* Let's ensure that the Ultimate field's claimed inventory is included in the Standard and Super fields'.
49+
*/
5150
$fields_to_alter = array( $ultimate_field_id );
5251
} else {
5352
return $query;
5453
}
5554

56-
foreach( $fields_to_alter as $current_field_id ) {
55+
foreach ( $fields_to_alter as $current_field_id ) {
5756
$query['where'] = preg_replace(
5857
"/\(e.form_id = {$form_id} AND em.form_id = {$form_id} AND em.meta_key = '{$current_field_id}'\) AND ([a-z0-9_]+)\.meta_value = '(.*?)' AND [a-z0-9_]+\.meta_value = '(.*?)'/",
5958
"(e.form_id = {$form_id} AND em.form_id = {$form_id} AND em.meta_key = '{$current_field_id}') AND \${1}.meta_value = '\${2}'",

gp-inventory/gpi-inventory-shortcode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
* Instruction Video: https://www.loom.com/share/9d1897075b7b435389479d4f17fc6807
77
*
88
* Update "123" to your form ID and "4" to your field ID with inventory.
9-
*
9+
*
1010
* `[gravityforms action="inventory" id="123" field="4"]`
1111
*
1212
* If using a field with scopes, you may provide the scope values in a comma-delimited list:
13-
*
13+
*
1414
* `[gravityforms action="inventory" id="123" field="4" scope_values="Scope Value,Another Scope Value"]`
1515
*
1616
* This snippet requires GP Inventory 1.0-beta-1.7 or newer.

gp-nested-forms/gpnf-map-child-entries-to-acf-repeater-field.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function gw_child_entries_to_repeater( $post_id, $feed, $entry, $form ) {
2525
if ( $form['id'] !== $this->_args['form_id'] ) {
2626
return;
2727
}
28-
28+
2929
$parent_entry = new GPNF_Entry( $entry );
3030
$child_entries = $parent_entry->get_child_entries( $this->_args['nested_form_field_id'] );
3131
$repeat_value = array();
@@ -45,12 +45,12 @@ function gw_child_entries_to_repeater( $post_id, $feed, $entry, $form ) {
4545
}
4646

4747
new GPNF_Map_Child_Entries_To_ACF_Repeater( array(
48-
'form_id' => 7, // Set this to the parent form ID
49-
'nested_form_field_id' => 18, // Update to the ID of the Nested Form field.
50-
'field_map' => array(
51-
'num_comedien' => 1,
52-
'role_comedien' => 3,
48+
'form_id' => 7, // Set this to the parent form ID
49+
'nested_form_field_id' => 18, // Update to the ID of the Nested Form field.
50+
'field_map' => array(
51+
'num_comedien' => 1,
52+
'role_comedien' => 3,
5353
), // The field map contains "field_name" => "child_entry_field_id" pairs. The field name is the name of the fields in
5454
// the ACF Repeater field. The child entry field ID is the field ID from the child form.
55-
'acf_repeater_field_name' => 'comediens', // Update to the field name of the ACF repeater field.
55+
'acf_repeater_field_name' => 'comediens', // Update to the field name of the ACF repeater field.
5656
) );
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
33
* This snippet has evolved! 🦄
4-
* Find the new version of this snippet here:
4+
* Find the new version of this snippet here:
55
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-conditional-logic-entry-meta.php
66
*/

gravity-forms/display-number-of-entries-left.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*
66
* Instruction Video: https://www.loom.com/share/b6c46aebf0ff483496faf9994e36083e
77
*
8-
* Instructions:
9-
*
8+
* Instructions:
9+
*
1010
* 1. Install the snippet.
1111
* https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
1212
*/

gravity-forms/gw-cache-buster.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function set_form_styles( $form, $style_settings, $form_theme ) {
6868
// Form styles specifically set to false disables inline form css styles.
6969
$form_styles = false;
7070
} else {
71-
$form_styles = !empty( $style_settings ) ? json_decode( $style_settings, true ) : array();
71+
$form_styles = ! empty( $style_settings ) ? json_decode( $style_settings, true ) : array();
7272
}
7373

7474
// Removing theme from styles for consistency. $form['theme'] should be used instead.
@@ -93,8 +93,8 @@ public function shortcode( $markup, $attributes, $content ) {
9393
'cachebuster' => false,
9494

9595
// Attributes needed for theme/styles.
96-
'theme' => method_exists( 'GFForms', 'get_default_theme' ) ? GFForms::get_default_theme() : '',
97-
'styles' => '',
96+
'theme' => method_exists( 'GFForms', 'get_default_theme' ) ? GFForms::get_default_theme() : '',
97+
'styles' => '',
9898
),
9999
$attributes
100100
);
@@ -212,16 +212,16 @@ public function get_cachebuster_markup( $markup, $atts, $content ) {
212212

213213
// Get the form theme.
214214
if ( method_exists( 'GFFormDisplay', 'get_form_theme_slug' ) ) {
215-
$form = $this->set_form_styles( GFAPI::get_form( $form_id ), rgar( $atts, 'styles' ), rgar( $atts, 'theme' ) );
215+
$form = $this->set_form_styles( GFAPI::get_form( $form_id ), rgar( $atts, 'styles' ), rgar( $atts, 'theme' ) );
216216
$form_theme = GFFormDisplay::get_form_theme_slug( $form );
217217
} else {
218218
$form_theme = null;
219219
}
220220

221221
// Still needed for the AJAX submission.
222222
$ajax_params = array(
223-
'action' => 'gfcb_get_form',
224-
'form_id' => $form_id,
223+
'action' => 'gfcb_get_form',
224+
'form_id' => $form_id,
225225
'form_theme' => $form_theme,
226226
);
227227

@@ -269,7 +269,8 @@ public function get_cachebuster_markup( $markup, $atts, $content ) {
269269
GFFormDisplay::post_render_script(
270270
$form_id,
271271
GFFormDisplay::get_current_page( $form_id )
272-
) );
272+
)
273+
);
273274
?>
274275
} );
275276
} );

gravity-forms/gw-disable-form-submission.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class GW_Disable_Form_Submission {
2929
*/
3030
public function __construct( $args = array() ) {
3131
$this->_args = wp_parse_args( $args, array(
32-
'form_ids' => array(),
32+
'form_ids' => array(),
3333
) );
3434

3535
add_action( 'init', array( $this, 'init' ) );
@@ -71,5 +71,5 @@ public function is_applicable_form( $form ) {
7171
// replace with form IDs you would like to disable form submission for
7272
'form_ids' => array(
7373
6,
74-
)
74+
),
7575
));

gravity-forms/gw-disable-submit-button-until-required-fields-are-filled-out.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public function output_script() {
8989
self.runCheck();
9090
});
9191
// GPPA logic may enable submit button, disable that logic.
92-
gform.addFilter( 'gppa_disable_form_navigation_toggling', function() {
93-
return true;
92+
gform.addFilter( 'gppa_disable_form_navigation_toggling', function() {
93+
return true;
9494
});
9595

9696
self.runCheck();
@@ -195,6 +195,7 @@ public function get_required_input_html_ids( $form ) {
195195
$html_ids[] = "#gform_preview_{$form['id']}_{$field['id']}";
196196
break;
197197
}
198+
// Let single file enabled File Upload field be handled as default.
198199

199200
default:
200201
$html_ids[] = "#input_{$form['id']}_{$field['id']}";

0 commit comments

Comments
 (0)