Skip to content

Commit e303482

Browse files
authored
Merge branch 'master' into saif/fix/40733-modify-by-gppa-field-value
2 parents e1122d6 + 62668ca commit e303482

File tree

744 files changed

+20618
-3973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

744 files changed

+20618
-3973
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @gravitywiz/engineering-wizards

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"phpcompatibility/phpcompatibility-wp": "*"
66
},
77
"scripts": {
8-
"lint": "phpcs",
8+
"lint": "phpcs -s",
99
"lint:fix": "phpcbf"
1010
},
1111
"config": {

composer.lock

Lines changed: 21 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dangerfile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ if (danger.git.created_files.length) {
4848
danger.git.diffForFile(createdFile).then(diff => {
4949
const hasGFSnippetHeader = diff.added.match(/^\+\s+\*\s+Gravity Wiz \/\/ Gravity Forms \/\/ (.*)$/m);
5050
const hasPerkSnippetHeader = diff.added.match(/^\+\s+\*\s+Gravity Perks \/\/ (.*) \/\/ (.*)$/m);
51+
const hasEvolvedSnippetHeader = diff.added.match(/^.*This snippet has evolved!.*$/m);
5152
const hasLoomVideo = diff.added.match(/loom.com\/share/m);
5253

53-
if (!hasGFSnippetHeader && !hasPerkSnippetHeader) {
54+
if (!hasGFSnippetHeader && !hasPerkSnippetHeader && !hasEvolvedSnippetHeader) {
5455
fail(createdFile + ": it looks like this file does not have the appropriate snippet header.")
5556
}
5657

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Gravity Perks // Gravity Forms // Trigger calculations on click of image for Image Choice
3+
* https://gravitywiz.com/
4+
*
5+
* This snippet is needed to work around a bug in Gravity Forms 2.9 where calculations are not
6+
* re-processed when the actual image of an Image Choice is clicked. It works fine if you click on
7+
* the label or the checkbox/radio itself.
8+
*
9+
* Instructions:
10+
*
11+
* 1. Install this snippet with our free Custom JavaScript plugin.
12+
* https://gravitywiz.com/gravity-forms-code-chest/
13+
*/
14+
$( '#gform_GFFORMID input:checkbox, #gform_GFFORMID input:radio' ).on( 'change', function (event) {
15+
var $target = $( event.target );
16+
if ( !$target.closest( '.gfield-image-choice-wrapper-inner' ).length ) {
17+
return;
18+
}
19+
20+
var _GFCalc = rgars( window, 'gf_global/gfcalc/{0}'.gformFormat( GFFORMID ) );
21+
_GFCalc.runCalcs( GFFORMID, _GFCalc.formulaFields );
22+
});
Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
<?php
22
/**
3-
* Gravity Wiz // Gravity Forms Chained Selects // Auto Select Only Option
4-
* https://gravitywiz.com/
5-
*
6-
* The Gravity Forms Chained Selects field requires you to manually select a value in each Drop Down
7-
* even if there is only a single option available in that Drop Down. This snippet will automatically
8-
* selected an option when it is the only option available.
3+
* We're no longer using the experimental folder for experimental snippets. 🚧
4+
* You can now find the snippet here:
5+
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gfcs-auto-chained-select.php.php
96
*/
10-
add_filter( 'gform_chained_selects_input_choices', function( $choices ) {
11-
$choices = gfcs_auto_select_only_choice( $choices );
12-
return $choices;
13-
} );
14-
15-
function gfcs_auto_select_only_choice( $choices ) {
16-
17-
$choices[0]['isSelected'] = $choices[0]['isSelected'] || count( $choices ) <= 1;
18-
19-
if ( ! empty( $choices['choices'] ) ) {
20-
$choices['choices'] = gfcs_auto_select_only_choice( $choices['choices'] );
21-
}
22-
23-
return $choices;
24-
}
Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
11
<?php
22
/**
3-
* Gravity Forms // Custom Javascript // Load Init Scripts Early
4-
* https://gravitywiz.com/gravity-forms-custom-javascript/
5-
*
6-
* Some perks (e.g. Copy Cat, Address Autocomplete) allow their initialization options to be filtered but the Custom JS
7-
* plugin outputs its scripts too late. This changes bumps GF Custom JS scripts to be output first.
8-
*
9-
* Developer Note: It's not possible to simply change the priority of the "gform_register_init_scripts" filter as
10-
* field-based init scripts are registered before the filter is called.
11-
*/
12-
add_action( 'gform_register_init_scripts', function( $form ) {
13-
14-
$scripts = rgar( GFFormDisplay::$init_scripts, $form['id'] );
15-
if ( empty( $scripts ) ) {
16-
return;
17-
}
18-
19-
$filtered = array();
20-
foreach ( $scripts as $slug => $script ) {
21-
if ( strpos( $slug, 'gf_custom_js' ) === 0 ) {
22-
$filtered = array( $slug => $script ) + $filtered;
23-
} else {
24-
$filtered[ $slug ] = $script;
25-
}
26-
}
27-
28-
GFFormDisplay::$init_scripts[ $form['id'] ] = $filtered;
29-
30-
}, 100 /* right after GF Custom JS */ );
3+
* We're no longer using the experimental folder for experimental snippets. 🚧
4+
* You can now find the snippet here:
5+
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gfjs-early-init-scripts.php
6+
*/
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22
/**
3-
* Gravity Forms // Submit to Access // Auto-allow Access for Administrators
4-
* https://gravitywiz.com/submit-gravity-form-access-content/
3+
* We're no longer using the experimental folder for experimental snippets. 🚧
4+
* You can now find the snippet here:
5+
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gfsa-auto-allow-administrator-access.php
56
*/
6-
add_filter( 'gfsa_has_access', function( $has_access ) {
7-
return current_user_can( 'administrator' );
8-
} );
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
/**
3+
* We're no longer using the experimental folder for experimental snippets. 🚧
4+
* You can now find the snippet here:
5+
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gp-hide-perks-from-plugins-page.php
6+
*/
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?php
22
/**
3-
* Gravity Perks // Update Perks Tab Field Settings Title
4-
* https://gravitywiz.com/
3+
* We're no longer using the experimental folder for experimental snippets. 🚧
4+
* You can now find the snippet here:
5+
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gp-update-perks-tab-title.php
56
*/
6-
add_action( 'gform_field_settings_tabs', function( $tabs ) {
7-
foreach ( $tabs as &$tab ) {
8-
if ( $tab['title'] === __( 'Perks', 'gravityperks' ) ) {
9-
// Update "Bonus Features" to whatever you want to call the perks tab.
10-
$tab['title'] = 'Bonus Features';
11-
}
12-
}
13-
return $tabs;
14-
}, 99 );

0 commit comments

Comments
 (0)