bp_avatar_use_webcam

Checks whether the Webcam Avatar UI part should be loaded.

Description

bp_avatar_use_webcam(); 

Usage

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

Defined (1)

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

/bp-core/bp-core-avatars.php  
  1. function bp_avatar_use_webcam() { 
  2. global $is_safari, $is_IE, $is_chrome; 
  3.  
  4. /** 
  5. * Do not use the webcam feature for mobile devices 
  6. * to avoid possible confusions. 
  7. */ 
  8. if ( wp_is_mobile() ) { 
  9. return false; 
  10.  
  11. /** 
  12. * Bail when the browser does not support getUserMedia. 
  13. * @see http://caniuse.com/#feat=stream 
  14. */ 
  15. if ( $is_safari || $is_IE || ( $is_chrome && ! is_ssl() ) ) { 
  16. return false; 
  17.  
  18. /** 
  19. * Use this filter if you need to disable the webcam capture feature 
  20. * by returning false. 
  21. * @since 2.3.0 
  22. * @param bool $value Whether or not to load Webcam Avatar UI part. 
  23. */