21 if( ! is_admin() ) {
return; }
35 add_action(
'wp_print_scripts', array( $this,
'no_conflict_scripts' ), 1000);
36 add_action(
'admin_print_footer_scripts', array( $this,
'no_conflict_scripts' ), 9);
38 add_action(
'wp_print_styles', array( $this,
'no_conflict_styles' ), 1000);
39 add_action(
'admin_print_styles', array( $this,
'no_conflict_styles' ), 11);
40 add_action(
'admin_print_footer_scripts', array( $this,
'no_conflict_styles' ), 1);
41 add_action(
'admin_footer', array( $this,
'no_conflict_styles' ), 1);
54 if( !
gravityview()->request->is_admin(
'', null ) ) {
58 $no_conflict_mode =
gravityview()->plugin->settings->get(
'no_conflict_mode' );
60 if( empty( $no_conflict_mode ) ) {
64 $wp_allowed_scripts = array(
93 'jquery-ui-datepicker',
98 'jquery-ui-draggable',
99 'jquery-ui-droppable',
100 'jquery-ui-accordion',
116 if( !
gravityview()->request->is_admin(
'', null ) ) {
122 if( !empty( $wp_styles->registered ) ) {
123 foreach ($wp_styles->registered as $key => $style) {
124 if( preg_match(
'/^(?:wp\-)?jquery/ism', $key ) ) {
125 wp_dequeue_style( $key );
130 $no_conflict_mode =
gravityview()->plugin->settings->get(
'no_conflict_mode' );
133 if( empty( $no_conflict_mode ) ) {
137 $wp_allowed_styles = array(
145 'wp-jquery-ui-dialog',
146 'jquery-ui-sortable',
150 'gravityview_settings',
161 do_action(
'gravityview_remove_conflicts_after');
181 $required_objects = apply_filters(
"gravityview_noconflict_{$type}", $required_objects );
183 $allow_prefixes = array(
192 $allow_regex =
'/^' . implode(
'|', $allow_prefixes ) .
'/ism';
196 foreach( $wp_objects->queue as $object ) {
197 if( in_array( $object, $required_objects ) || preg_match( $allow_regex, $object ) ) {
201 $wp_objects->queue = $queue;
206 $registered = array();
207 foreach( $wp_objects->registered as $handle => $script_registration ){
208 if( in_array( $handle, $required_objects ) || preg_match( $allow_regex, $handle ) ){
209 $registered[ $handle ] = $script_registration;
212 $wp_objects->registered = $registered;
227 $dependents = array();
228 foreach ( $scripts as $script ) {
229 $deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array();
230 foreach ( $deps as $dep ) {
231 if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) {
232 $dependents[] = $dep;
236 $scripts = array_merge( $scripts, $dependents );
237 }
while ( ! empty( $dependents ) );
remove_conflicts(&$wp_objects, $required_objects, $type='scripts')
Remove any style or script non-registered in the no conflict mode.
no_conflict_styles()
Callback to eliminate any non-registered style.
no_conflict_scripts()
Callback to eliminate any non-registered script.
new GravityView_Admin_No_Conflict
add_script_dependencies($registered, $scripts)
Add dependencies.
gravityview()
The main GravityView wrapper function.
add_hooks()
Add the hooks to fix script and style conflicts.