Automattic\Jetpack\Device_Detection

User_Agent_Info::is_J2ME_platform()public staticWPSCache 1.0

Returns if the device belongs to J2ME capable family.

Метод класса: User_Agent_Info{}

Хуков нет.

Возвращает

true|false.

Использование

$result = User_Agent_Info::is_J2ME_platform();

Код User_Agent_Info::is_J2ME_platform() WPSCache 1.12.4

public static function is_J2ME_platform() {

	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

	$agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.

	if ( strpos( $agent, 'j2me/midp' ) !== false ) {
		return true;
	} elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) {
		return true;
	}
	return false;
}