Advertisement
fauzanjeg

Fix Conflict with WPForms plugin

Sep 23rd, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. /** Fix Conflict with WPForms plugin */
  2. function fix_conflict_with_wp_forms_plugin() {
  3.     if ( isset( $_GET['page'] ) ) {
  4.         $page =  $_GET['page'];
  5.         $page = explode( '-', $page );
  6.         if ( 'wpforms' === $page[0] ) { /* If WPForms plugin Page */
  7.             remove_action( 'admin_enqueue_scripts', array( \Jeg\Form\Form_Builder::get_instance(), 'form_control_script' ), 10 );
  8.             wp_enqueue_script(
  9.                 'jeg-form-builder-script',
  10.                 JEG_URL . '/assets/js/form/form-builder.js',
  11.                 array(
  12.                     'jquery',
  13.                     'underscore',
  14.                     'wp-util',
  15.                     'customize-controls',
  16.                     'customize-base',
  17.                     'wp-color-picker',
  18.                     'jquery-ui-spinner',
  19.                 ),
  20.                 jeg_get_version(),
  21.                 true
  22.             );
  23.         }
  24.     }
  25. }
  26. add_action( 'admin_enqueue_scripts', 'fix_conflict_with_wp_forms_plugin', 100 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement