/** * Loads MDetect library */ public static function mdetect() { if (!class_exists('uagent_info')) { require_once dirname(__FILE__) . '/lib/mdetect/mdetect.php'; $agent = new uagent_info(); $is_mobile = $agent->DetectMobileQuick(); $is_tablet = $agent->DetectTierTablet(); if (true == $is_mobile) { PhotoSwipe::$device = 'mobile'; } elseif (true == $is_tablet) { PhotoSwipe::$device = 'tablet'; } else { PhotoSwipe::$device = 'desktop'; } add_action('wp_head', array('PhotoSwipe', 'wp_head')); } }
public function photoSwipe(PhotoSwipe $model, $arg, $bool) { return $model->parse($arg); }