Skip to content

Commit 1400ca3

Browse files
authored
Deregister Vue as a Dependency
1 parent 94171eb commit 1400ca3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Gravity Perks // File Upload Pro // Deregister Vue as a Dependency
4+
* https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
5+
*
6+
* File Upload Pro utilizes Vue as the backing framework for its JavaScript
7+
* on both the frontend and in the form editor. In the event that File Upload Pro’s
8+
* bundled version of Vue is conflicting with another registered version of Vue,
9+
* it can be deregistered using the following snippet.
10+
*/
11+
add_filter( 'gpfup_scripts', function ( $scripts ) {
12+
foreach ( $scripts as &$script ) {
13+
if ( $script['handle'] !== 'gp-file-upload-pro' ) {
14+
continue;
15+
}
16+
17+
$script['deps'] = array_diff( $script['deps'], array( 'gravityperks-vue-2' ) );
18+
}
19+
20+
return $scripts;
21+
} );

0 commit comments

Comments
 (0)