<?php
class WPPAS_Detect
{
	
	/**
	 * FUNCTION TO CHECK DEVICES
	 *
	 */
	public static function device($args = array())
	{
		global $wppas_mobile_detect;
		
		$defaults = array(
			'is' => 'is_mobile'
		);
		$args = wp_parse_args( $args, $defaults );
		
		if( $args['is'] == 'is_mobile')
		{
			return apply_filters( 'is_mobile', $wppas_mobile_detect->isMobile(), $wppas_mobile_detect );
		}
		elseif( $args['is'] == 'is_tablet')
		{
			return apply_filters( 'is_tablet', $wppas_mobile_detect->isTablet(), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_iphone')
		{
			return apply_filters( 'is_iphone', $wppas_mobile_detect->isIphone(), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_ipad')
		{
			return apply_filters( 'is_ipad', $wppas_mobile_detect->isIpad(), $wppas_mobile_detect );
		}
		elseif( $args['is'] == 'is_ipod')
		{
			return apply_filters( 'is_ipod', $wppas_mobile_detect->is( 'iPod' ), $wppas_mobile_detect );
		}
		elseif( $args['is'] == 'is_ios')
		{
			return apply_filters( 'is_ios', $wppas_mobile_detect->isiOS(), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_android')
		{
			return apply_filters( 'is_android', $wppas_mobile_detect->isAndroidOS(), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_blackberry')
		{
			return apply_filters( 'is_blackberry', $wppas_mobile_detect->isBlackBerry(), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_windows_mobile')
		{
			return apply_filters(
				'is_windows_mobile',
				( $wppas_mobile_detect->is( 'WindowsMobileOS' ) || $wppas_mobile_detect->is( 'WindowsPhoneOS' ) ),
				$wppas_mobile_detect
			);
		}
		elseif( $args['is'] == 'is_motorola')
		{
			return apply_filters( 'is_motorola', $wppas_mobile_detect->is( 'Motorola' ), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_samsung')
		{
			return apply_filters( 'is_samsung', $wppas_mobile_detect->is( 'Samsung' ), $wppas_mobile_detect );	
		}
		elseif( $args['is'] == 'is_sony_ericsson')
		{
			return apply_filters( 'is_sony_ericsson', $wppas_mobile_detect->is( 'Sony' ), $wppas_mobile_detect );	
		}
	}
	
}