From 99137d3ca4e061781afa3267528599d027915fc0 Mon Sep 17 00:00:00 2001 From: Clay Griffiths Date: Mon, 7 Feb 2022 10:14:36 -0600 Subject: [PATCH] ~ Run PHPCBF (composer lint:fix) --- experimental/gpdtc-recalc.php | 2 +- experimental/gpepee-conditional-edit.php | 4 +- experimental/gpi-auto-selections.php | 21 +- experimental/gpi-packaged-products.php | 16 +- experimental/gpml-auto-add-terms.php | 10 +- ...-scripts-from-cloudflare-rocket-loader.php | 2 +- ...ulate-multiple-items-from-repeater-row.php | 4 +- ...-enable-choice-values-for-gravity-view.php | 6 +- experimental/gppa-gv-display-field-value.php | 2 +- .../gppa-multi-file-value-as-links.php | 6 +- .../gppa-object-type-acf-options-page.php | 32 +- .../gppa-populate-date-in-fields-format.php | 8 +- .../gppa-wc-country-to-gf-address-field.php | 2 +- experimental/gppa-woo-commerce-lmt.php | 8 +- experimental/gpuid-clear-index.php | 14 +- experimental/gpuid-custom-format-ABC12345.php | 8 +- experimental/gw-add-attachments-by-field.php | 6 +- experimental/gw-capture-file-extension.php | 6 +- experimental/gw-create-extra-entry.php | 4 +- .../gw-field-ids-in-editor-labels.php | 2 +- experimental/gw-minimum-file-count.php | 1 - experimental/gw-preview-mode-tweaks.php | 70 ++-- experimental/gw-rich-text-html-fields.php | 2 +- .../gpaa-search-by-place-name.php | 6 +- .../gpaa-single-line-as-input.php | 118 +++--- .../gpbua-set-redirect-url-by-entry-value.php | 2 +- .../gpcp-product-pricing-labels.php | 7 +- ...p-enable-multi-page-navigation-on-edit.php | 2 +- .../gpep-save-token-to-field.php | 2 +- .../gpecf-consolidate-discounts.php | 10 +- gp-ecommerce-fields/gpecf-custom-total.php | 16 +- ...ize-order-summary-markup-with-modifier.php | 28 +- .../gpecf-customize-order-summary-markup.php | 30 +- gp-ecommerce-fields/gpecf-deduct-deposit.php | 3 +- .../gpecf-dynamically-set-discount.php | 5 +- ...d-product-options-order-summary-markup.php | 38 +- ...f-remove-field-label-from-option-label.php | 4 +- .../gpecf-set-discount-dynamically.php | 1 - .../gpecf-tax-amounts-by-field-value.php | 2 +- gp-file-upload-pro/gpfup-big-images.css | 14 +- gp-file-upload-pro/gpfup-file-icons.css | 8 +- gp-file-upload-pro/gpfup-single-file.css | 12 +- gp-inventory/gpi-waiting-list.php | 2 +- .../gplcb-conditional-limits.php | 86 ++--- gp-limit-choices/gplc-daily-limit.php | 12 +- gp-limit-choices/gplc-shared-limits.php | 62 ++-- .../gplc-spots-left-admin-only.php | 18 +- .../gplc-spots-left-plus-waiting-list.php | 20 +- .../gpld-block-reserved-date-ranges.php | 2 +- ...gpld-disable-all-dates-with-exceptions.php | 4 +- ...d-exclude-blocked-dates-from-modifiers.php | 202 +++++----- .../gpld-mobile-styling-inline-datepicker.css | 8 +- .../gpls-apply-limit-collectively.php | 6 +- .../gpls-apply-same-feed-to-group.php | 4 +- .../gpls-disable-for-gravity-view.php | 4 +- gp-limit-submissions/gpls-global-feeds.php | 4 +- .../gplp-filter-preview-template-path.php | 2 +- gp-media-library/gpml-ajax-upload.php | 146 ++++---- .../gpml-attachment-id-merge-tag.php | 4 +- .../gpml-change-upload-directory.php | 2 +- ...sable-multi-page-navigation-page-links.css | 12 +- ...nf-add-child-entry-total-in-entry-list.php | 2 +- ...add-custom-classes-to-add-entry-button.php | 2 +- .../gpnf-auto-attach-child-files.php | 4 +- ...f-change-modal-title-and-submit-button.php | 8 +- .../gpnf-custom-parent-form-merge-tags.php | 10 +- gp-nested-forms/gpnf-disable-sessions.php | 10 +- ...pnf-display-child-entries-table-format.php | 2 +- .../gpnf-display-image-file-upload.php | 2 +- .../gpnf-display-value-drop-down-product.php | 6 +- .../gpnf-do-not-trash-child-entries.php | 2 +- ...nf-fillablepdfs-auto-attach-child-pdfs.php | 4 +- .../gpnf-gv-auto-attach-child-entries.php | 2 +- gp-nested-forms/gpnf-per-page-sessions.php | 6 +- gp-nested-forms/gpnf-short-labels.php | 4 +- ...sync-parent-child-entry-payment-status.php | 2 +- gp-nested-forms/gpnf-triggered-population.php | 42 +-- .../gppa-acf-repeater-mapper.php | 4 +- .../gppa-filter-by-relative-dates.php | 10 +- .../gppa-force-dyn-pop-on-gv-edit.php | 2 +- .../gppa-lmt-diff-modifier.php | 2 +- .../gppa-merge-tag-context-modifier.php | 8 +- .../gppa-populate-child-entries.php | 6 +- .../gppa-postmeta-property-value-limit.php | 2 +- .../gppa-preserve-selections.php | 2 +- .../gppa-set-current-form-on-duplicate.php | 10 +- .../gppa-set-post-taxonomy-terms.php | 14 +- .../gppcmt-save-confirmation-url-to-field.php | 4 +- gp-price-range/gppr-validation-messages.php | 20 +- gp-read-only/gpro-disable-for-admins.php | 12 +- gp-unique-id/gpuid-dynamic-population.php | 20 +- gp-unique-id/gpuid-global-sequential-id.php | 14 +- gp-unique-id/gpuid-input-masks.php | 8 +- .../gpuid-populate-on-pre-submission.php | 10 +- ...gpuid-set-authorize-net-invoice-number.php | 28 +- gp-unique-id/gpuid-shared-sequences.php | 4 +- .../gpuid-site-address-title-validation.php | 5 +- gp-unique-id/gpuid-username-validation.php | 4 +- ...d-wait-for-payment-support-for-payfast.php | 10 +- ...pwc-disable-limits-for-logged-in-users.php | 2 +- .../display-number-of-entries-left.php | 6 +- .../gw-advanced-conditional-shortcodes.php | 19 +- gravity-forms/gw-all-fields-template.php | 4 +- .../gw-allow-create-and-update-feeds.php | 115 +++--- gravity-forms/gw-cache-buster.php | 2 +- gravity-forms/gw-checkbox-to-acf.php | 2 +- gravity-forms/gw-choice-counter-usage.php | 2 +- gravity-forms/gw-coupons-exclude-products.php | 30 +- .../gw-currency-symbol-right-to-left.php | 2 +- gravity-forms/gw-current-time-merge-tags.php | 27 +- gravity-forms/gw-daily-form-schedule.php | 33 +- ...n-until-required-fields-are-filled-out.php | 201 +++++----- .../gw-double-confirmation-fields.php | 2 +- .../gw-edit-product-and-payment-details.php | 351 +++++++++--------- gravity-forms/gw-email-domain-validator.php | 155 ++++---- gravity-forms/gw-entry-count-shortcode.php | 10 +- .../gw-feed-specific-submit-button.php | 20 +- .../gw-field-to-field-conditional-logic.php | 4 +- gravity-forms/gw-force-default-value.php | 49 ++- .../gw-hide-css-fields-from-all-fields.php | 4 +- gravity-forms/gw-inventory.php | 16 +- .../gw-list-field-as-choices-usage.php | 30 +- gravity-forms/gw-list-field-as-choices.php | 236 ++++++------ gravity-forms/gw-manual-notifications.php | 25 +- .../gw-merge-tag-modifier-prepend-append.php | 4 +- gravity-forms/gw-multi-file-merge-tag.php | 10 +- .../gw-multiple-entries-list-field.php | 154 ++++---- .../gw-numbering-list-field-rows.css | 36 +- gravity-forms/gw-populate-date.php | 9 +- gravity-forms/gw-progress-meter.php | 1 - gravity-forms/gw-quantity-as-decimal.php | 21 +- gravity-forms/gw-redirect-if-email-exists.php | 68 ++-- .../gw-require-unique-values-usage.php | 20 +- gravity-forms/gw-require-unique-values.php | 48 ++- .../gw-save-and-continue-auto-load.php | 16 +- ...schedule-post-by-date-field-multi-form.php | 90 ++--- .../gw-send-notifications-to-merge-tags.php | 2 +- gravity-forms/gw-set-entry-created-by.php | 6 +- .../gw-set-list-field-rows-by-field-value.php | 6 +- .../gw-set-range-by-field-values.php | 4 +- gravity-forms/gw-simple-approval.php | 141 +++---- gravity-forms/gw-submit-to-access.php | 8 +- gravity-forms/gw-time-field-drop-downs.php | 6 +- .../gw-time-sensitive-choices-usage.php | 10 +- gravity-forms/gw-time-sensitive-choices.php | 2 +- gravity-forms/gw-update-posts.php | 2 +- ...n-skip-registration-for-existing-email.php | 61 ++- .../gw-validate-current-password.php | 4 +- .../gw-validate-that-a-value-exists.php | 89 ++--- gravity-forms/gw-zip-files.php | 49 ++- wc-gf-product-addons/wcgfpa-remove-fields.php | 195 +++++----- ...fpa-remove-price-from-cart-description.php | 2 +- ...cgfpa-remove-qty-from-cart-description.php | 2 +- .../wcgfpa-use-choice-labels.php | 6 +- 154 files changed, 1936 insertions(+), 1934 deletions(-) diff --git a/experimental/gpdtc-recalc.php b/experimental/gpdtc-recalc.php index 8e3b24f8a..2a2f4ba9d 100644 --- a/experimental/gpdtc-recalc.php +++ b/experimental/gpdtc-recalc.php @@ -3,7 +3,7 @@ * Re-calculate a GPDTC calculated field dynamically every time it's viewed. */ add_action( 'wp_loaded', function() { - $form_id = 13; // Change this to the form's ID + $form_id = 13; // Change this to the form's ID $field_id = 132; // Change this to the Age's field ID if ( class_exists( 'GP_Date_Time_Calculator' ) ) { $values = array(); diff --git a/experimental/gpepee-conditional-edit.php b/experimental/gpepee-conditional-edit.php index bffde7929..ec1294d24 100644 --- a/experimental/gpepee-conditional-edit.php +++ b/experimental/gpepee-conditional-edit.php @@ -2,8 +2,8 @@ /** * Gravity Perks // Easy Passthrough Edit Entry // Conditional Edit * https://gravitywiz.com/edit-gravity-forms-entries-on-the-front-end/ - * - * Create a field on your form and check for a specific value on that field to determine if the passed + * + * Create a field on your form and check for a specific value on that field to determine if the passed * through entry should be edited or if a new entry should be created. */ // Update "123" to the form you are using to edit entries. diff --git a/experimental/gpi-auto-selections.php b/experimental/gpi-auto-selections.php index 49145ff4d..04ccc0647 100644 --- a/experimental/gpi-auto-selections.php +++ b/experimental/gpi-auto-selections.php @@ -5,8 +5,8 @@ */ global $gpias_form_id, $gpias_list_field_id, $gpias_product_field_id; -$gpias_form_id = 123; -$gpias_list_field_id = 4; +$gpias_form_id = 123; +$gpias_list_field_id = 4; $gpias_product_field_id = 5; add_filter( "gform_column_input_{$gpias_form_id}_{$gpias_list_field_id}_1", function( $input_info, $field, $column, $value, $form_id ) { @@ -32,7 +32,7 @@ global $gpias_list_field_id, $gpias_product_field_id; $list_field = GFAPI::get_field( $form, $gpias_list_field_id ); - $booths = $list_field->get_value_submission( array() ); + $booths = $list_field->get_value_submission( array() ); foreach ( $form['fields'] as $field ) { @@ -42,13 +42,16 @@ while ( ! empty( $booths ) ) { - $booth = array_shift( $booths ); - $_POST["input_{$field->id}"] = $booth; + $booth = array_shift( $booths ); + $_POST[ "input_{$field->id}" ] = $booth; - $_fields = $form['fields']; + $_fields = $form['fields']; $form['fields'] = array( $field ); - $result = gp_inventory_type_choices()->validation( array( 'is_valid' => true, 'form' => $form ) ); + $result = gp_inventory_type_choices()->validation( array( + 'is_valid' => true, + 'form' => $form, + ) ); $form['fields'] = $_fields; @@ -56,14 +59,12 @@ $field->failed_validation = false; return $form; } - } if ( empty( $booths ) ) { - $list_field->failed_validation = true; + $list_field->failed_validation = true; $list_field->validation_message = 'None of your selected booths are available.'; } - } return $form; diff --git a/experimental/gpi-packaged-products.php b/experimental/gpi-packaged-products.php index b6b07039c..f5c29ef5f 100644 --- a/experimental/gpi-packaged-products.php +++ b/experimental/gpi-packaged-products.php @@ -46,17 +46,17 @@ public function __construct( $args = array() ) { public function init() { add_filter( 'gpi_claimed_inventory_' . $this->form_id, array( $this, - 'package_field_claimed_inventory' + 'package_field_claimed_inventory', ), 10, 2 ); add_filter( 'gpi_claimed_inventory_' . $this->form_id, array( $this, - 'add_claimed_package_inventory_to_individual_products' + 'add_claimed_package_inventory_to_individual_products', ), 10, 2 ); add_filter( 'gpi_requested_quantity_' . $this->form_id, array( $this, - 'add_requested_packages_to_individual_products' + 'add_requested_packages_to_individual_products', ), 10, 2 ); } @@ -70,7 +70,7 @@ public function package_field_claimed_inventory( $package_claimed_inventory, $fi remove_filter( 'gpi_claimed_inventory_' . $this->form_id, array( $this, - 'add_claimed_package_inventory_to_individual_products' + 'add_claimed_package_inventory_to_individual_products', ) ); $inventory_limit = gp_inventory_type_advanced()->get_stock_quantity( $this->package_field ); @@ -92,7 +92,7 @@ public function package_field_claimed_inventory( $package_claimed_inventory, $fi add_filter( 'gpi_claimed_inventory_' . $this->form_id, array( $this, - 'add_claimed_package_inventory_to_individual_products' + 'add_claimed_package_inventory_to_individual_products', ), 10, 2 ); return $package_claimed_inventory; @@ -108,14 +108,14 @@ public function add_claimed_package_inventory_to_individual_products( $claimed_i remove_filter( 'gpi_claimed_inventory_' . $this->form_id, array( $this, - 'package_field_claimed_inventory' + 'package_field_claimed_inventory', ) ); $claimed_packages_inventory = gp_inventory_type_advanced()->get_claimed_inventory( $this->package_field ); add_filter( 'gpi_claimed_inventory_' . $this->form_id, array( $this, - 'package_field_claimed_inventory' + 'package_field_claimed_inventory', ), 10, 2 ); return (int) $claimed_inventory + (int) $claimed_packages_inventory; @@ -142,5 +142,5 @@ public function add_requested_packages_to_individual_products( $requested_quanti new GP_Inventory_Packaged_Products( array( 'form_id' => 2, 'package_field_id' => 4, - 'field_ids_in_package' => array( 1, 2 ) + 'field_ids_in_package' => array( 1, 2 ), ) ); diff --git a/experimental/gpml-auto-add-terms.php b/experimental/gpml-auto-add-terms.php index 26fadf8f3..34b242c33 100644 --- a/experimental/gpml-auto-add-terms.php +++ b/experimental/gpml-auto-add-terms.php @@ -1,21 +1,21 @@ array( 'Red', 'Green', - 'Blue' + 'Blue', ), 'post_tag' => array( 'Small', 'Medium', - 'Large' - ) + 'Large', + ), ); $gpml_media_data['post_data']['tax_input'] = $terms; return $gpml_media_data; diff --git a/experimental/gpnf-exclude-gf-inline-scripts-from-cloudflare-rocket-loader.php b/experimental/gpnf-exclude-gf-inline-scripts-from-cloudflare-rocket-loader.php index be968360a..e813dc79b 100644 --- a/experimental/gpnf-exclude-gf-inline-scripts-from-cloudflare-rocket-loader.php +++ b/experimental/gpnf-exclude-gf-inline-scripts-from-cloudflare-rocket-loader.php @@ -5,7 +5,7 @@ */ add_filter( 'wp_inline_script_attributes', function ( $attributes, $javascript ) { if ( strpos( $javascript, 'gform.' ) ) { - $attributes['data-cfasync'] = 'false'; + $attributes['data-cfasync'] = 'false'; } return $attributes; }, 10, 2 ); diff --git a/experimental/gppa-acf-populate-multiple-items-from-repeater-row.php b/experimental/gppa-acf-populate-multiple-items-from-repeater-row.php index 8217cf4d9..a1a809ec3 100644 --- a/experimental/gppa-acf-populate-multiple-items-from-repeater-row.php +++ b/experimental/gppa-acf-populate-multiple-items-from-repeater-row.php @@ -7,8 +7,8 @@ add_filter( 'gppa_input_choices_123_4', function( $choices, $field, $objects ) { $filtered = array(); foreach ( $choices as $choice ) { - $index = explode( '_', $choice['object']['meta_key'] )[1]; - $is_available = (bool) get_post_meta( $choice['object']['post_id'],substr( $choice['object']['meta_key'], 0, -5 ) . 'tillganglighet', true ); + $index = explode( '_', $choice['object']['meta_key'] )[1]; + $is_available = (bool) get_post_meta( $choice['object']['post_id'], substr( $choice['object']['meta_key'], 0, -5 ) . 'tillganglighet', true ); if ( $is_available ) { $title = get_post_meta( $choice['object']['post_id'], "plats_{$index}_plats_och_datum_plats", true ); $choice['text'] .= sprintf( ' (%s)', $title ); diff --git a/experimental/gppa-enable-choice-values-for-gravity-view.php b/experimental/gppa-enable-choice-values-for-gravity-view.php index 178c6a82d..3b6525de8 100644 --- a/experimental/gppa-enable-choice-values-for-gravity-view.php +++ b/experimental/gppa-enable-choice-values-for-gravity-view.php @@ -1,8 +1,8 @@ enableChoiceValue = true; } } - + return $form; } ); diff --git a/experimental/gppa-gv-display-field-value.php b/experimental/gppa-gv-display-field-value.php index 4bcab643b..3210789c4 100644 --- a/experimental/gppa-gv-display-field-value.php +++ b/experimental/gppa-gv-display-field-value.php @@ -7,7 +7,7 @@ // Update "123" to your form ID. Update to "4", "5", and "6" to your field IDs. $targets = array( - 123 => array( 4, 5, 6 ) + 123 => array( 4, 5, 6 ), ); if ( ! function_exists( 'gravityview' ) || ! gravityview()->request->is_view() ) { diff --git a/experimental/gppa-multi-file-value-as-links.php b/experimental/gppa-multi-file-value-as-links.php index ed6ea265e..c032ab52b 100644 --- a/experimental/gppa-multi-file-value-as-links.php +++ b/experimental/gppa-multi-file-value-as-links.php @@ -2,16 +2,16 @@ /** * Gravity Perks // Populate Anything // Format Comma-delimited List of Files as Links * https://gravitywiz.com/documentation/gravity-forms-populate-anything/ - * + * * Populate a Single Line Text field with the value of a Multi-file Upload field and then use this snippet to display * the file URLs as links instead of plain text. */ // Update "123" to your form ID and "4" to the field ID being populated with your file URLs. add_filter( 'gppa_live_merge_tag_value_348_2', function( $merge_tag_match_value, $merge_tag, $form, $field_id, $entry_values ) { - $urls = explode( ', ', $merge_tag_match_value ); + $urls = explode( ', ', $merge_tag_match_value ); $links = array(); foreach ( $urls as $url ) { $links[] = sprintf( '%s', $url, basename( $url ) ); } - return implode( "
", $links ); + return implode( '
', $links ); }, 10, 5 ); diff --git a/experimental/gppa-object-type-acf-options-page.php b/experimental/gppa-object-type-acf-options-page.php index 5b2363788..4ac80185d 100644 --- a/experimental/gppa-object-type-acf-options-page.php +++ b/experimental/gppa-object-type-acf-options-page.php @@ -7,7 +7,7 @@ * Advanced Custom Fields. For more on Options Pages, see https://www.advancedcustomfields.com/resources/options-page/ * * Installation: https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ - * + * * Known Limitations: * * Filtering is not supported with this Object Type */ @@ -29,24 +29,24 @@ public function get_options_pages() { } public function get_properties( $options_page = null ) { - $field_groups = acf_get_field_groups(array( - 'options_page' => $options_page - )); + $field_groups = acf_get_field_groups(array( + 'options_page' => $options_page, + )); - $properties = array(); + $properties = array(); - foreach ( $field_groups as $field_group ) { - $fields = acf_get_fields( $field_group ); + foreach ( $field_groups as $field_group ) { + $fields = acf_get_fields( $field_group ); - foreach ( $fields as $field ) { - $properties[ $field['name'] ] = array( - 'value' => $field['name'], - 'label' => $field['label'], - 'callable' => '__return_false', - 'orderby' => false, - ); - } - } + foreach ( $fields as $field ) { + $properties[ $field['name'] ] = array( + 'value' => $field['name'], + 'label' => $field['label'], + 'callable' => '__return_false', + 'orderby' => false, + ); + } + } return $properties; } diff --git a/experimental/gppa-populate-date-in-fields-format.php b/experimental/gppa-populate-date-in-fields-format.php index 0b31aa64b..13cbdd274 100644 --- a/experimental/gppa-populate-date-in-fields-format.php +++ b/experimental/gppa-populate-date-in-fields-format.php @@ -6,14 +6,14 @@ add_filter( 'gppa_process_template_value', function( $value, $field ) { if ( $field->get_input_type() === 'date' && $field->dateType === 'datepicker' ) { list( $format, $separator ) = array_pad( explode( '_', $field->dateFormat ), 2, 'slash' ); - $separators = array( + $separators = array( 'slash' => '/', 'dash' => '-', 'dot' => '.', ); - $format = str_replace( 'y', 'Y', $format ); - $format = implode( $separators[ $separator ], str_split( $format ) ); - $value = date( $format, strtotime( $value ) ); + $format = str_replace( 'y', 'Y', $format ); + $format = implode( $separators[ $separator ], str_split( $format ) ); + $value = date( $format, strtotime( $value ) ); } return $value; }, 10, 2 ); diff --git a/experimental/gppa-wc-country-to-gf-address-field.php b/experimental/gppa-wc-country-to-gf-address-field.php index 221d71fcb..063f8c9d8 100644 --- a/experimental/gppa-wc-country-to-gf-address-field.php +++ b/experimental/gppa-wc-country-to-gf-address-field.php @@ -6,7 +6,7 @@ // Update "26" to your Address field ID. Leave the ".6" alone. add_filter( 'gppa_process_template_26.6', function( $template_value, $field, $template_name, $populate, $object, $object_type, $objects, $template ) { if ( $template === 'meta_billing_country' ) { - $countries = GF_Fields::get( 'address' )->get_default_countries(); + $countries = GF_Fields::get( 'address' )->get_default_countries(); $template_value = rgar( $countries, $template_value, $template_value ); } return $template_value; diff --git a/experimental/gppa-woo-commerce-lmt.php b/experimental/gppa-woo-commerce-lmt.php index 5bfabec15..e5bbdccc9 100644 --- a/experimental/gppa-woo-commerce-lmt.php +++ b/experimental/gppa-woo-commerce-lmt.php @@ -4,11 +4,13 @@ * See: https://secure.helpscout.net/conversation/1520295750/24633?folderId=3808239 */ add_action( 'wp', function() { - if ( ! function_exists('WC' ) || ( ! is_cart() && ! is_checkout() ) ) return; + if ( ! function_exists( 'WC' ) || ( ! is_cart() && ! is_checkout() ) ) { + return; + } foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { - add_filter( 'gform_pre_render', function( $form ) use ($cart_item) { + add_filter( 'gform_pre_render', function( $form ) use ( $cart_item ) { $gravity_form_data = $cart_item['_gravity_form_data']; - $form_meta = RGFormsModel::get_form_meta( $gravity_form_data['id'] ); + $form_meta = RGFormsModel::get_form_meta( $gravity_form_data['id'] ); foreach ( $form_meta['fields'] as $field_index => $field ) { if ( ! $field['choices'] ) { continue; diff --git a/experimental/gpuid-clear-index.php b/experimental/gpuid-clear-index.php index a77748c77..971627d79 100644 --- a/experimental/gpuid-clear-index.php +++ b/experimental/gpuid-clear-index.php @@ -3,7 +3,9 @@ * Clear all indexes for GPUID. */ add_action( 'admin_init', function() { - if ( ! rgget( 'gpuid_clear_indexes' ) ) return; + if ( ! rgget( 'gpuid_clear_indexes' ) ) { + return; + } // Ensure GPUID is disabled if ( class_exists( 'GP_Unique_ID' ) ) { wp_redirect( '/wp-admin/plugins.php?plugin_status=active&guid_clear_indexes_error_active=true' ); @@ -30,24 +32,24 @@ } ); add_action( 'admin_notices', function ( $messages ) { - if ( rgget( 'guid_clear_indexes_error_active' ) ): + if ( rgget( 'guid_clear_indexes_error_active' ) ) : ?>

Please disable GP Unique ID before attempting to clear the indexes.

GP Unique ID table indexes were cleared. Please de-activate this snippet and enable GPUID again.

-

GP Unique ID Clear Indexes snippet is active. If you have already cleared the indexes please remove it. Otherwise you can start clearing indexes here.

- id ); @@ -42,11 +42,11 @@ function gw_add_attachments_by_field( $notification, $form, $entry, $notificatio if ( $field->multipleFiles ) { $uploaded_files = json_decode( stripslashes( $url ), true ); foreach ( $uploaded_files as $uploaded_file ) { - $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $uploaded_file ); + $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $uploaded_file ); $notification['attachments'][] = $attachment; } } else { - $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $url ); + $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $url ); $notification['attachments'][] = $attachment; } diff --git a/experimental/gw-capture-file-extension.php b/experimental/gw-capture-file-extension.php index 88211a542..f942ae615 100644 --- a/experimental/gw-capture-file-extension.php +++ b/experimental/gw-capture-file-extension.php @@ -3,9 +3,9 @@ * Gravity Wiz // Gravity Forms // Capture File Extension * https://gravitywiz.com/ * - * Capture the file extension of any file uploaded into a File Upload field on submission. + * Capture the file extension of any file uploaded into a File Upload field on submission. * This only works with single File Upload fields. - * + * * @see https://www.loom.com/share/52b2c139ed42465c9230cf05d9b7fc16 */ // Update "123" to your form ID. @@ -13,7 +13,7 @@ // Update "4" to the ID of your File Upload field. $file_upload_field_id = 4; - + // Update "5" to the ID of the field in which the file extension should be captured. $ext_field_id = 5; diff --git a/experimental/gw-create-extra-entry.php b/experimental/gw-create-extra-entry.php index b0b87ac43..46d8713f8 100644 --- a/experimental/gw-create-extra-entry.php +++ b/experimental/gw-create-extra-entry.php @@ -2,9 +2,9 @@ /** * Gravity Wiz // Gravity Forms // Create an Extra Entry if Checkbox is Checked * https://gravitywiz.com/ - * + * * Create an additional entry identical to the first if a specified checkbox is checked. - * + * * @see https://stackoverflow.com/a/69497108/227711 */ // Update "123" to your form ID. diff --git a/experimental/gw-field-ids-in-editor-labels.php b/experimental/gw-field-ids-in-editor-labels.php index 4519f2a2f..11a3bde7b 100644 --- a/experimental/gw-field-ids-in-editor-labels.php +++ b/experimental/gw-field-ids-in-editor-labels.php @@ -14,7 +14,7 @@ static $_gw_inline_field_id_style; if ( ! $_gw_inline_field_id_style ) { - $content .= ' + $content .= ' - _args = wp_parse_args( $args, array( - 'form_id' => false, - 'address_field_id' => false, - 'single_line_field_id' => false, - ) ); + $this->_args = wp_parse_args( $args, array( + 'form_id' => false, + 'address_field_id' => false, + 'single_line_field_id' => false, + ) ); - add_action( 'init', array( $this, 'init' ) ); + add_action( 'init', array( $this, 'init' ) ); - } + } - public function init() { + public function init() { - add_filter( 'gform_pre_render', array( $this, 'load_form_script' ), 10, 2 ); - add_filter( 'gform_register_init_scripts', array( $this, 'add_init_script' ), 10, 2 ); - add_filter( 'gpaa_init_args_' . $this->_args['form_id'] . '_' . $this->_args['address_field_id'], array( $this, 'add_gpaa_init' ), 10, 2 ); + add_filter( 'gform_pre_render', array( $this, 'load_form_script' ), 10, 2 ); + add_filter( 'gform_register_init_scripts', array( $this, 'add_init_script' ), 10, 2 ); + add_filter( 'gpaa_init_args_' . $this->_args['form_id'] . '_' . $this->_args['address_field_id'], array( $this, 'add_gpaa_init' ), 10, 2 ); - } + } - public function load_form_script( $form, $is_ajax_enabled ) { + public function load_form_script( $form, $is_ajax_enabled ) { - if ( $this->is_applicable_form( $form ) && ! has_action( 'wp_footer', array( $this, 'output_script' ) ) ) { - add_action( 'wp_footer', array( $this, 'output_script' ) ); - add_action( 'gform_preview_footer', array( $this, 'output_script' ) ); - } + if ( $this->is_applicable_form( $form ) && ! has_action( 'wp_footer', array( $this, 'output_script' ) ) ) { + add_action( 'wp_footer', array( $this, 'output_script' ) ); + add_action( 'gform_preview_footer', array( $this, 'output_script' ) ); + } - return $form; - } + return $form; + } - public function output_script() { - ?> + public function output_script() { + ?> - + - is_applicable_form( $form ) ) { - return; - } + if ( ! $this->is_applicable_form( $form ) ) { + return; + } - $args = array( - 'formId' => $this->_args['form_id'], - 'addressFieldId' => $this->_args['address_field_id'], - 'singleLineFieldId' => $this->_args['single_line_field_id'], - ); + $args = array( + 'formId' => $this->_args['form_id'], + 'addressFieldId' => $this->_args['address_field_id'], + 'singleLineFieldId' => $this->_args['single_line_field_id'], + ); - $script = 'new GPAASingleLineInput( ' . json_encode( $args ) . ' );'; - $slug = implode( '_', array( 'gw_js_snippet_template', $this->_args['form_id'], $this->_args['address_field_id'] ) ); + $script = 'new GPAASingleLineInput( ' . json_encode( $args ) . ' );'; + $slug = implode( '_', array( 'gw_js_snippet_template', $this->_args['form_id'], $this->_args['address_field_id'] ) ); - GFFormDisplay::add_init_script( $this->_args['form_id'], $slug, GFFormDisplay::ON_PAGE_RENDER, $script ); + GFFormDisplay::add_init_script( $this->_args['form_id'], $slug, GFFormDisplay::ON_PAGE_RENDER, $script ); - } + } - public function add_gpaa_init( $args ){ + public function add_gpaa_init( $args ) { - $args['inputSelectors']['autocomplete'] = '#input_' . $this->_args['form_id'] . '_' . $this->_args['single_line_field_id']; + $args['inputSelectors']['autocomplete'] = '#input_' . $this->_args['form_id'] . '_' . $this->_args['single_line_field_id']; - return $args; + return $args; - } + } - public function is_applicable_form( $form ) { + public function is_applicable_form( $form ) { - $form_id = isset( $form['id'] ) ? $form['id'] : $form; + $form_id = isset( $form['id'] ) ? $form['id'] : $form; - return empty( $this->_args['form_id'] ) || (int) $form_id == (int) $this->_args['form_id']; - } + return empty( $this->_args['form_id'] ) || (int) $form_id == (int) $this->_args['form_id']; + } } // Configuration -new GPAA_Single_Line_Input ( array( - 'form_id' => 123, // The ID of your form. - 'address_field_id' => 4, // The ID of the Address field. - 'single_line_field_id' => 5 // The ID of the Single Line Text field. +new GPAA_Single_Line_Input( array( + 'form_id' => 123, // The ID of your form. + 'address_field_id' => 4, // The ID of the Address field. + 'single_line_field_id' => 5, // The ID of the Single Line Text field. ) ); diff --git a/gp-better-user-activation/gpbua-set-redirect-url-by-entry-value.php b/gp-better-user-activation/gpbua-set-redirect-url-by-entry-value.php index c98d00c53..97170715a 100644 --- a/gp-better-user-activation/gpbua-set-redirect-url-by-entry-value.php +++ b/gp-better-user-activation/gpbua-set-redirect-url-by-entry-value.php @@ -11,7 +11,7 @@ $entry = $activation->get_signup()->lead; // Update "123" to your target form ID. - if( $entry['form_id'] == 123 ) { + if ( $entry['form_id'] == 123 ) { // Update "1" to the field ID containing the page ID to which you would like to redirect. $url = get_permalink( $entry[1] ); } diff --git a/gp-conditional-pricing/gpcp-product-pricing-labels.php b/gp-conditional-pricing/gpcp-product-pricing-labels.php index b65b6849e..e4c3a23df 100644 --- a/gp-conditional-pricing/gpcp-product-pricing-labels.php +++ b/gp-conditional-pricing/gpcp-product-pricing-labels.php @@ -12,9 +12,10 @@ // No need to edit below. if ( $field->type === 'product' ) { - $template = str_replace( '{label}', $choice['text'], $template ); - $replace = sprintf( ' data-gpcp-template="%s">%s<', $template, str_replace( '{price}', GFCommon::to_money( $choice['price'] ), $template ) ); - $choice_markup = str_replace( ">{$choice['text']}<", $replace, $choice_markup );; + $template = str_replace( '{label}', $choice['text'], $template ); + $replace = sprintf( ' data-gpcp-template="%s">%s<', $template, str_replace( '{price}', GFCommon::to_money( $choice['price'] ), $template ) ); + $choice_markup = str_replace( ">{$choice['text']}<", $replace, $choice_markup ); + } return $choice_markup; diff --git a/gp-easy-passthrough/gpep-enable-multi-page-navigation-on-edit.php b/gp-easy-passthrough/gpep-enable-multi-page-navigation-on-edit.php index 15402ff9f..41e80de0a 100644 --- a/gp-easy-passthrough/gpep-enable-multi-page-navigation-on-edit.php +++ b/gp-easy-passthrough/gpep-enable-multi-page-navigation-on-edit.php @@ -14,7 +14,7 @@ if ( is_callable( 'gp_easy_passthrough' ) ) { $session = gp_easy_passthrough()->session_manager(); $update_entry_id = $session[ gp_easy_passthrough()->get_slug() . '_' . $form['id'] ]; - if( $update_entry_id ) { + if ( $update_entry_id ) { $_POST['gw_page_progression'] = GFFormDisplay::get_max_page_number( $form ); } } diff --git a/gp-easy-passthrough/gpep-save-token-to-field.php b/gp-easy-passthrough/gpep-save-token-to-field.php index cfeabc23b..d5f078bfa 100644 --- a/gp-easy-passthrough/gpep-save-token-to-field.php +++ b/gp-easy-passthrough/gpep-save-token-to-field.php @@ -12,7 +12,7 @@ // Update "4" to the ID of the field you woule like to populate with the EP token. $target_field_id = 4; - if( is_callable( 'gp_easy_passthrough' ) ) { + if ( is_callable( 'gp_easy_passthrough' ) ) { $token = gp_easy_passthrough()->get_entry_token( $entry ); GFAPI::update_entry_field( $entry['id'], $target_field_id, $token ); $entry[ $target_field_id ] = $token; diff --git a/gp-ecommerce-fields/gpecf-consolidate-discounts.php b/gp-ecommerce-fields/gpecf-consolidate-discounts.php index 38745a0a0..8881387bf 100644 --- a/gp-ecommerce-fields/gpecf-consolidate-discounts.php +++ b/gp-ecommerce-fields/gpecf-consolidate-discounts.php @@ -9,19 +9,19 @@ // Update "123" to your form ID - or - remove "_123" to apply to all forms. add_filter( 'gpecf_order_summary_123', function( $summary ) { - if( empty( $summary['discounts'] ) ) { + if ( empty( $summary['discounts'] ) ) { return $summary; } - $consolidated_discount = $summary['discounts'][0]; - $consolidated_discount['name'] = 'Discounts'; + $consolidated_discount = $summary['discounts'][0]; + $consolidated_discount['name'] = 'Discounts'; $consolidated_discount['price'] = 0; - foreach( $summary['discounts'] as $discount ) { + foreach ( $summary['discounts'] as $discount ) { $consolidated_discount['price'] += $discount['price']; } $summary['discounts'] = array( $consolidated_discount ); return $summary; -} ); \ No newline at end of file +} ); diff --git a/gp-ecommerce-fields/gpecf-custom-total.php b/gp-ecommerce-fields/gpecf-custom-total.php index 92acf83dc..ef18ffc92 100644 --- a/gp-ecommerce-fields/gpecf-custom-total.php +++ b/gp-ecommerce-fields/gpecf-custom-total.php @@ -6,12 +6,14 @@ // Update "123" with your form ID. add_filter( 'gpecf_order_summary_123', function( $order_summary ) { - $order_summary['total'] = array_merge( array( array( - 'name' => 'Recurring Total', - 'price' => '$400', - 'quantity' => 1, - 'class' => 'total' - ) ), $order_summary['total'] ); + $order_summary['total'] = array_merge( array( + array( + 'name' => 'Recurring Total', + 'price' => '$400', + 'quantity' => 1, + 'class' => 'total', + ), + ), $order_summary['total'] ); return $order_summary; -} ); \ No newline at end of file +} ); diff --git a/gp-ecommerce-fields/gpecf-customize-order-summary-markup-with-modifier.php b/gp-ecommerce-fields/gpecf-customize-order-summary-markup-with-modifier.php index 8b0b7acd9..083458428 100644 --- a/gp-ecommerce-fields/gpecf-customize-order-summary-markup-with-modifier.php +++ b/gp-ecommerce-fields/gpecf-customize-order-summary-markup-with-modifier.php @@ -17,7 +17,8 @@ function get_custom_order_summary_markup( $markup, $order, $form, $entry, $order - is_ecommerce_product( $product ) ) { continue; } @@ -30,13 +31,13 @@ function get_custom_order_summary_markup( $markup, $order, $form, $entry, $order