bp_core_current_user_ua

Get the current user's user-agent.

Description

(string) bp_core_current_user_ua(); 

Returns (string)

User agent string.


Usage

  1. if ( !function_exists( 'bp_core_current_user_ua' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-moderation.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_current_user_ua(); 
  7.  

Defined (1)

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

/bp-core/bp-core-moderation.php  
  1. function bp_core_current_user_ua() { 
  2.  
  3. // Sanity check the user agent. 
  4. if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { 
  5. $retval = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ); 
  6. } else { 
  7. $retval = ''; 
  8.  
  9. /** 
  10. * Filters the current user's user-agent. 
  11. * @since 1.6.0 
  12. * @param string $retval Current user's user-agent. 
  13. */