wc_get_user_agent

Get user agent string.

Description

(string) wc_get_user_agent(); 

Returns (string)


Usage

  1. if ( !function_exists( 'wc_get_user_agent' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_get_user_agent(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-core-functions.php  
  1. function wc_get_user_agent() { 
  2. return isset( $_SERVER['HTTP_USER_AGENT'] ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';