Mobile Detect conflict
-
Hi Jordy,
Great plugin – but I was wondering if you might make an update that checks for the Mobile_Detect class before firing off a new instance? I’m using Mobble with a site and it uses the Mobile_Detect class. The combination of it plus WP Retina 2x s problematic if Mobile_Detect tries to activate.
I think just checking for
if ( class_exists( 'Mobile_Detect') )
before kicking off a new instance would work. Something like this ( lines 50 & 51 in wp-retina-2x.php ):if ( wr2x_getoption( "ignore_mobile", "wr2x_advanced", false ) && !class_exists( 'Mobile_Detect' ) ) require('inc/Mobile_Detect.php');
then again ( lines 72-75 in wp-retina-2x.php ):
if ( wr2x_getoption( "ignore_mobile", "wr2x_advanced", false ) && !class_exists( 'Mobile_Detect' ) ) { $mobileDetect = new Mobile_Detect(); $is_retina = !$mobileDetect->isMobile(); }
and lastly ( lines 574 to 578 ):
else if ( wr2x_getoption( "ignore_mobile", "wr2x_advanced", false ) && !class_exists( 'Mobile_Detect' ) ) { $mobileDetect = new Mobile_Detect(); if ( $mobileDetect->isMobile() ) return; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Mobile Detect conflict’ is closed to new replies.