| @@ -1,0 +1,64 @@ | ||
| 1 | +<?php | |
| 2 | +/* | |
| 3 | + * License: GPLv3 | |
| 4 | + * License URI: https://www.gnu.org/licenses/gpl.txt | |
| 5 | + * Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/) | |
| 6 | + */ | |
| 7 | + | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + | |
| 10 | + die( 'These aren\'t the droids you\'re looking for.' ); | |
| 11 | +} | |
| 12 | + | |
| 13 | +if ( ! class_exists( 'WpssoIntegFormGravityforms' ) ) { | |
| 14 | + | |
| 15 | + class WpssoIntegFormGravityforms { | |
| 16 | + | |
| 17 | + private $p; // Wpsso class object. | |
| 18 | + | |
| 19 | + public function __construct( &$plugin ) { | |
| 20 | + | |
| 21 | + $this->p =& $plugin; | |
| 22 | + | |
| 23 | + if ( $this->p->debug->enabled ) { | |
| 24 | + | |
| 25 | + $this->p->debug->mark(); | |
| 26 | + } | |
| 27 | + | |
| 28 | + if ( is_admin() ) { | |
| 29 | + | |
| 30 | + add_action( 'gform_noconflict_styles', array( $this, 'cleanup_gform_noconflict_styles' ) ); | |
| 31 | + add_action( 'gform_noconflict_scripts', array( $this, 'cleanup_gform_noconflict_scripts' ) ); | |
| 32 | + } | |
| 33 | + } | |
| 34 | + | |
| 35 | + public function cleanup_gform_noconflict_styles( $styles ) { | |
| 36 | + | |
| 37 | + return array_merge( $styles, array( | |
| 38 | + 'jquery-ui.js', | |
| 39 | + 'jquery-qtip.js', | |
| 40 | + 'sucom-metabox-tabs', | |
| 41 | + 'sucom-settings-page', | |
| 42 | + 'sucom-settings-table', | |
| 43 | + 'wp-color-picker', | |
| 44 | + 'wpsso-admin-page', | |
| 45 | + ) ); | |
| 46 | + } | |
| 47 | + | |
| 48 | + public function cleanup_gform_noconflict_scripts( $scripts ) { | |
| 49 | + | |
| 50 | + return array_merge( $scripts, array( | |
| 51 | + 'jquery-ui-datepicker', | |
| 52 | + 'jquery-qtip', | |
| 53 | + 'sucom-admin-media', | |
| 54 | + 'sucom-admin-page', | |
| 55 | + 'sucom-metabox', | |
| 56 | + 'sucom-settings-page', | |
| 57 | + 'sucom-tooltips', | |
| 58 | + 'wp-color-picker', | |
| 59 | + 'wpsso-metabox', | |
| 60 | + 'wpsso-block-editor', | |
| 61 | + ) ); | |
| 62 | + } | |
| 63 | + } | |
| 64 | +} | |